Answered step by step
Verified Expert Solution
Link Copied!

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 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago