Hardware Reference
In-Depth Information
read_gates function
In this function, if input_sensor value equals 1 (it means there is a car in the entrance
of the parking lot) and the capacity is greater than 0, then microcontroller issues a com-
mand to move the arm gate up to let the car get in. The perm1==1 condition prevents from
repeating this instruction
if((input_sensor==1)&&(capacity>0)&&(perm1==1))
{
input_motor_up=1;
input_motor_down=0;
counter_perm=1
perm1=0;
}
In addition, the content of Cunter_perm variable is changed to 1 to have a permission to
deduct the parking capacity in future.
After the entrance arm gate is moved up completely ( input_up_ms==1) , the in-
put_down_time variable is set to active a timer to close the entrance gate after a specific
time (more explanation will be given in the later text). The entrance gate stays open for
about 5 seconds to give the driver enough time to go past underneath the arm gate.
if(input_up_ms==1)
{
input_motor_up=0;
input_down_time=1;
}
Then entrance arm gate moves back to its original position and the related motor is turned
off when the related limit switch is activated.
if(input_down_ms==1)
{
input_motor_down=0;
Search WWH ::




Custom Search