Saturday, April 3, 2010

Challenge #7- 7.1

For this challenge, we were introduced to shaft encoders which are built in the NXT motors. They allow you to sense how much the motor's "shaft" has rotated.

We first connected the shaft encoder on our breadboard, connecting S1 and S2 the inputs 1 and 2 respectively on the LogoChip. We then used the oscilloscope to monitor the shaft encoder. As we turned the NXT motor, we were able to see the edges of S1 on channel 1 of the oscilloscope.

We then had to write a program that counts and prints the edges of S1 as we turned the motor by hand.
This was a relatively simple program because we didn't have to take in account switch bounces and the direction that we turned the motor in, therefore the count always increased.

No comments:

Post a Comment