Task # 4– Toll Booth
Mission:
The local airport needs to place a toll booth gate at the exit of a parking lot. One sensor (bumpSwitch) will be needed to open the gate and one sensor will be needed to close (limitSwitch) the gate. A red light should be on when the gate is down or moving. When the vehicle goes through the intersection the gate will be up and the red light needs to be off and a green light needs to be on to indicate that the car can go through the gate.
Programming:
*Turn redLED on, turn greenLED off, & Turn off yellowLED
*Make this program a continuous loop.
*You will also have 2 If statements (1 for the bumpSwitch and 1 for the limitSwitch. Both will be ==1).
*When the gate is in the down position or moving the redLED is on and the greenLED is off.
*When the gate is not moving and in the up position the greenLED is on and the redLED is off.
*To open the gate, push the bumpSwitch. You will stop the gate by using the lineFollower. Your speed will be under 25.
*To close the gate, push the limitSwitch. You will use a wait time to stop the gate.Your speed will be negative & needs under 25.
Motor and Sensor Setup:
Motor 1- leftMotor
Analog 1- lineFollower
Digital 5- bumpSwitch
Digital 6- limitSwitch
Digital 7- greenLED
Digital 9- redLED