Question: Advanced Design: You work on this only after finished tasks in Basic Design In Design Task 2 , the disadvantage of continuously checking the return

Advanced Design: You work on this only after finished tasks in Basic Design
In Design Task 2, the disadvantage of continuously checking the return of the pulse is that we
have to wait until there is a pulse, and the Arduino can do nothing while waiting.
To solve this, we can use Interrupt. The Arduino can be triggered by an external event using a
digital pin. When event occurs, interrupt will be issued, and the Interrupt Service Routine will
be run. (Note: You can refer to the Lecture Notes for Arduino Programming to understand more
about Interrupt)
There are several modes to define when the interrupt should be triggered.
LOW to trigger the interrupt whenever the pin is low,
CHANGE to trigger the interrupt whenever the pin changes value
RISING to trigger when the pin goes from low to high,
FALLING for when the pin goes from high to low.
a) Advanced Task 1:
You are given the following design example. Use interrupt to redo Design Task 2.
Please help me with the Advance Task 1,
Design Task 2: 1) Connect the ultrasonic distance module to Arduino board
2) Write a program to read the distance between the sensor and the table surface for every
two seconds, and output the values to the Serial Monitor,
3) Now, ADD a feature such that the color of a RGB LED changes according to the distance.
Define your mapping between the color and the distance
 Advanced Design: You work on this only after finished tasks in

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 Databases Questions!