Question Solved1 Answer 10 Experiment 4: Combining All Three Experiments Now that you have been introduced to three different topics, it's time to put it all together. For your final project, you are to work with four different color LEDs, each one connected to its own Arduino pin: red, yellow, blue, green. By entering commands in the serial monitor, you can either turn an LED 10 Experiment 4: Combining All Three Experiments Now that you have been introduced to three different topics, it's time to put it all together. For your final project, you are to work with four different color LEDs, each one connected to its own Arduino pin: red, yellow, blue, green. By entering commands in the serial monitor, you can either turn an LED HIGH, LOW, ON with a specific intensity, or blink X times, with \( \mathrm{Y} \mathrm{ms} \) on and \( \mathrm{Z} \mathrm{ms} \) off each blink cycle. Note you should make a library to make the main code cleaner. As a guidance, your LED library should be called LED. The LED library should have the following functions: - Constructor - Turn the LED on - Turn the LED off - Set LED intensity (requires an integer input) - Blink the LED for \( \mathrm{X} \) times, with \( \mathrm{Y} \mathrm{ms} \) on, and \( \mathrm{Z} \) ms for each blink cycle. The user enter the LED, command, and input values on one line, and automatically figure out the proper information. For example, if the user wanted to set the red LED on, they enter "red,on" at the serial monitor. In the same token, if the user wanted to blink the yellow LED 5 times for 1000 \( \mathrm{ms} \) on, and \( 500 \mathrm{~ms} \) off, they would enter "yellow,blink, \( 5,1000,500 \) " in the serial monitor. As a guidance the student may want to research the following commands: - String methods \( - \). equals () - .toLowerCase() - .toCharArray()

23HXVO The Asker · Electrical Engineering

​​​​​​​I need arduino code

Transcribed Image Text: 10 Experiment 4: Combining All Three Experiments Now that you have been introduced to three different topics, it's time to put it all together. For your final project, you are to work with four different color LEDs, each one connected to its own Arduino pin: red, yellow, blue, green. By entering commands in the serial monitor, you can either turn an LED HIGH, LOW, ON with a specific intensity, or blink X times, with \( \mathrm{Y} \mathrm{ms} \) on and \( \mathrm{Z} \mathrm{ms} \) off each blink cycle. Note you should make a library to make the main code cleaner. As a guidance, your LED library should be called LED. The LED library should have the following functions: - Constructor - Turn the LED on - Turn the LED off - Set LED intensity (requires an integer input) - Blink the LED for \( \mathrm{X} \) times, with \( \mathrm{Y} \mathrm{ms} \) on, and \( \mathrm{Z} \) ms for each blink cycle. The user enter the LED, command, and input values on one line, and automatically figure out the proper information. For example, if the user wanted to set the red LED on, they enter "red,on" at the serial monitor. In the same token, if the user wanted to blink the yellow LED 5 times for 1000 \( \mathrm{ms} \) on, and \( 500 \mathrm{~ms} \) off, they would enter "yellow,blink, \( 5,1000,500 \) " in the serial monitor. As a guidance the student may want to research the following commands: - String methods \( - \). equals () - .toLowerCase() - .toCharArray()
More
Transcribed Image Text: 10 Experiment 4: Combining All Three Experiments Now that you have been introduced to three different topics, it's time to put it all together. For your final project, you are to work with four different color LEDs, each one connected to its own Arduino pin: red, yellow, blue, green. By entering commands in the serial monitor, you can either turn an LED HIGH, LOW, ON with a specific intensity, or blink X times, with \( \mathrm{Y} \mathrm{ms} \) on and \( \mathrm{Z} \mathrm{ms} \) off each blink cycle. Note you should make a library to make the main code cleaner. As a guidance, your LED library should be called LED. The LED library should have the following functions: - Constructor - Turn the LED on - Turn the LED off - Set LED intensity (requires an integer input) - Blink the LED for \( \mathrm{X} \) times, with \( \mathrm{Y} \mathrm{ms} \) on, and \( \mathrm{Z} \) ms for each blink cycle. The user enter the LED, command, and input values on one line, and automatically figure out the proper information. For example, if the user wanted to set the red LED on, they enter "red,on" at the serial monitor. In the same token, if the user wanted to blink the yellow LED 5 times for 1000 \( \mathrm{ms} \) on, and \( 500 \mathrm{~ms} \) off, they would enter "yellow,blink, \( 5,1000,500 \) " in the serial monitor. As a guidance the student may want to research the following commands: - String methods \( - \). equals () - .toLowerCase() - .toCharArray()
See Answer
Add Answer +20 Points
Community Answer
4IOKH0
See all the answers with 1 Unlock
Get 4 Free Unlocks by registration

what is arduino IDE: The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them Arduino IDE code for blinking three LEDs and displaying their outputs: const int LED = 8; // Assign pin 8 a name e.g. LED void setup() { Serial.begin (9600); //initialise the serial monitor data rate at 9600bps pinMode(LED, OUTPUT); //configure the digital pin as an output } void loop() { digitalWrite(LED, HIGH); //control the digital pin to turn the LED on Serial.println("LED is on"); //receive a signal in the serial monitor to show LED is on delay(2000); //a delay to blink the LED in 2 second intervals digitalWrite(LED, LOW); //control the digital pin to turn the LED off Serial.println("LED is off"); //receive a signal in the serial monitor to show LED is off delay(2000); //a delay to blink the LED in 2 second intervals } Basic arduino code for blinking 3 LEDs(RGB): int R = 10;int G = 11;int B = 12; // Assign integer R,G,B pins to 10,11,12 respectively void setup(){ pinMode // configure the digital pins R as Output (R,OUTPUT); pinMode // configure the digital pin R as output (G,OUTPUT); pinMode // configure the digital pin G as output (B,OUTPUT); } void loop(){ digitalWrite (R,L0W); delay (2000); digitalWrite (R,HIGH); delay (2000); digitalWrite (G,LOW); delay (1000); digitalWrite (G,HIGH); delay (1000); digitalWrite (B,LOW); delay (2000); digitalWrite (B,HIGH); delay (2000); } Description: 1.digitalWrite (R,HIGH); delay (1000); ... See the full answer