Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 :
You are given the following design example. Use interrupt to redo Design Task
Please help me with the Advance Task
Design Task : Connect the ultrasonic distance module to Arduino board
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,
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started