Hardware Reference
In-Depth Information
ing cost. The total cost is calculated by
calculate_price
function. This function receives
the number of the slot, and calculates its total cost.
if((car[x]==0)&&(car_perm[x]==1))
{
car_day_out[x]=day;
car_month_out[x]=month;
car_hour_out[x]=hour;
car_min_out[x]=minute;
car_sec_out[x]=sec;
total_price[x]=calculate_price(x);
car_perm[x]=0;
A condition is considered here to reduce effects of noise on system. If the entrance
time is equal to exit time or exit time is greater than entrance time by just one second, then
the program disregards the detected entrance or exit signal and resets all the related vari-
ables.
if((car_sec_in[x]==car_sec_out[x])||(car_sec_in[x]==(car_sec_out[x]+1)))
{
car_day_in[x]=0;
car_month_in[x]=0;
car_hour_in[x]=0;
car_min_in[x]=0;
car_sec_in[x]=0;
car_day_out[x]=0;
car_month_out[x]=0;
car_hour_out[x]=0;
car_min_out[x]=0;
car_sec_out[x]=0;
total_price[x]=0;
}
Search WWH ::
Custom Search