Question: Hardware: Using the light sensor and a button to control three different LEDs. / / / / / / Problem Statement: Build an Arduino project

Hardware: Using the light sensor and a button to control three different LEDs.
//
//
// Problem Statement: Build an Arduino project that uses the Light sensor and a button switch
// to control three LEDs. If the Light sensor shows dark light the Green LED. If the button
// is pushed light the Red LED. If both the Light sensor reads dark and the button is pushed
// light the blue LED and play a 2.5 kHz tone.
//
//
//
//**** Pseudocode Algorithm ****
//
// create a global integer variable LED_OnTime =200 msec
//
// setup()
//
// set pin 4 as input for button with a pullup resistor
// set pin 6 as input for Light sensor
// set pin 8 as output for Green LED
// set pin 9 as output for Red LED
// set pin 10 as output for Blue LED
// set pin 12 as output for the buzzer/speaker
//
//
//
// loop()
//
// if ( Light sensor == dark )
//
// Turn on Green LED for LED-On-time (use variable)//
//
// if ( button == pushed )
//
// Turn on Red LED for LED-On-time (use variable)
//
//
// if ( Light sensor == dark && button == pushed )// compound conditional
//
// Turn on Blue LED for LED-On-time (use variable)
//
//

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!