Question: Using C In code blocks Write a program that will control simple gate barrier system. The gate opens if a car is present and closes
"Using C In code blocks"

Write a program that will control simple gate barrier system. The gate opens if a car is present and closes 5 seconds after the car leaves (not present). The car is detected using the circuit below, which is connected to port H bit 7. PH7 (port H bit 7) is '0 if there is no obstacle (i.e., car not present) between the light source and the light detector and'1' if there is an obstacle(i.e., car is present) Pt. C 10K PH7 330 With Light oV '0 node No Light 5V1 Photo Transistor Light E Cathode Diode Activity 2: Gate Barrier System To simulate the opening and closing of the gate, display the percentage of opening using 3 seven segment displays 60% 0 % open Activity 2: Gate Barrier System Sequence of Operation 1. If a car is present, open the gate by displaying 0-100 at 5% increment every .5 sec (opening mode) 2. If the gate is clear(no car is present), wait for additional 5 seconds and close the gate by displaying 100-> 0 at 5% decrement every 0.5 sec. (closing mode) While in closing mode, any interruption, (i.e. , a new car is present), will change the mode of the system to opening mode 100 % open 3 Write a program that will control simple gate barrier system. The gate opens if a car is present and closes 5 seconds after the car leaves (not present). The car is detected using the circuit below, which is connected to port H bit 7. PH7 (port H bit 7) is '0 if there is no obstacle (i.e., car not present) between the light source and the light detector and'1' if there is an obstacle(i.e., car is present) Pt. C 10K PH7 330 With Light oV '0 node No Light 5V1 Photo Transistor Light E Cathode Diode Activity 2: Gate Barrier System To simulate the opening and closing of the gate, display the percentage of opening using 3 seven segment displays 60% 0 % open Activity 2: Gate Barrier System Sequence of Operation 1. If a car is present, open the gate by displaying 0-100 at 5% increment every .5 sec (opening mode) 2. If the gate is clear(no car is present), wait for additional 5 seconds and close the gate by displaying 100-> 0 at 5% decrement every 0.5 sec. (closing mode) While in closing mode, any interruption, (i.e. , a new car is present), will change the mode of the system to opening mode 100 % open 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
