Coding the dragster
The code for this project is designed to achieve the following objectives:
- The dragster needs to count down 3-2-1 to make sure people have time to move out of the way.
- The dragster needs to stop when it sees the red (or the color of choice) finish line.
- The dragster needs to display the time to avoid human error when using a stopwatch.
Connecting to the proper ports
Before we begin to code, you need to make sure you have all the parts properly connected to the Intelligent Hub. Start with the motors. The motors should be plugged into ports A and E. It does not matter which motor goes into which port if they are A and E, since the dragster will only move forward and backward.
Your color sensor will go into port C. This sensor will help your dragster identify and stop at the finish line:
For this program, you will have two code stacks. Additionally, you will be...