We first copied a code on the course website into the Procedures Window as text-language on PicoBlocks. This code created new blocks that allowed us to count in a separate thread and to watch the shaft encoders that control the two motors.
Like in Challenge #6, we went about making this program in two parts. We created two separate threads: one that tells the motor to go forward for a certain count and the other tells the motor to go backward for a certain count. We set that once counta was higher than 1000 (in the first part) or once counta was lower than 0 (for the second part), the motors would stop.
This is a picture of these two threads:
No comments:
Post a Comment