Question: Lab exp#5: Interrupts For Microcontroller AVR Atmega328p writing code on (C program code + ISIS) A car park has two gates, one for entering cars

Lab exp#5: "Interrupts"
For Microcontroller AVR Atmega328p writing code on
(C program code + ISIS) A car park has two gates, one for entering cars and the
other for leaving cars. When a car enters the parking area, a pressure
sensor activates a switch that is connected to pin INT0 which generates
external interrupt to open the enterance gate (LED at pin PC2) for the car to enter.
When a car exits the parking area, a pressure
sensor activates a switch that is connected to pin INT1 which generates
external interrupt to open the exit gate (LED at pin PC4) for the car to leave.
Define a glabal variable 'ncars' to hold the number of cars in the
parking area. If 'ncars' reaches 10, then disable the external interrupt
INT0 to prevent more cars from entering and turn on an LED on pin PB5
to show that there is no vacancy in the parking area. When 'ncars' gets
below 50, then enable the external interrupt INT0.
The system should always display 'ncars' on the PC screen every
5 seconds. This should be done via interrupt of TC1 to produce
the 5-seconds delay.
C program code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!