In notepad, bring up either the flashing light program or the sound program. Then, modify it so that it will work as follows:
- When switch 0 is turned on, motor 0 starts running.
- Motor 0 will then run for 2 seconds and stop.
- When motor 0 stops, motor 1 will start running.
- Motor 1 will run for 4 seconds and stop.
- If switch 0 is still on when motor 1 stops, the above cycle will repeat. Otherwise, both motors will stay stopped.
- Once you've gotten the program to turn on LEDs 0 and 1
correctly, connect your microcontroller card to a motor driver card and
have your program control real motors.
|