We have a push button, a photoresistor, a piezo and 3 LEDs;
LED1, LED2 & LED3:
The system starts when we push the button:
a. LED1, LED2, and LED3 turn ON and OFF simultaneously then the
piezo plays a sound for half second,
b. The system asks to input a number N to the serial monitor, if
he enters:
• 1; LED1 blinks for one time with piezo playing a sound for
half second,
• 2; LED2 blinks for one time with piezo playing another sound
for half second,
• 3; LED3 blinks for one time with piezo playing another sound
for half second,
• Any other number; The serial monitor displays the percentage
value of the photo resistor (between 0% & 100%), if the
value:
➢ Less than 100, LED1 turns ON with a brightness equal to this
value,
➢ Between 100 and 200, LED2 turns ON with a brightness equal to
this value,
➢ More than 200, LED3 turns ON with a brightness equal to this
value,
• 0; All stops again.
Remarks. simultaneously means at the same time, the previous LED
is OFF the other is ON.
We have a push button, a photoresistor, a piezo and 3 LEDs; LED1, LED2 & LED3: The system starts when we push the button
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
We have a push button, a photoresistor, a piezo and 3 LEDs; LED1, LED2 & LED3: The system starts when we push the button
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!