ARDUINO TUTORIAL FOR BEGINNERS LESSON 8: TURN ON LED USING SERIAL MONITOR

Поділитися
Вставка
  • Опубліковано 20 сер 2024
  • #ArduinoUno #SerialMonitor #ArduinoSerialMonitor
    ARDUINO TUTORIAL FOR BEGINNERS LESSON 8: TURN ON LED USING SERIAL MONITOR
    In this lesson, we are going to learn how to turn on a LED using the command in the serial monitor of the Arduino IDE. This Arduino tutorial for beginners will let you learn the concept behind serial monitor that can turn on different types of LED color according to your specified code.
    Reference: www.makerlab-e...
    Step by Step Tutorial: e-boombots.com...
    Learn about the Arduino Kit: • ARDUINO TUTORIAL FOR B...
    My Collection of Boards and Sensors: • ARDUINO BOARDS AND SEN...
    ARDUINO TUTORIAL FOR BEGINNERS LESSON 7: BUILDING A QUIZ BUZZER SYSTEM : • ARDUINO TUTORIAL FOR B...
    Best IoT Project: • i-Detect: IoT Voice-Ac...
    I have recommended stores where you can buy the components:
    e-boombots.com/
    www.makerlab-e...
    www.e-gizmo.ne...
    Lesson 8 Serial Monitor
    Introduction
    In this experiment, you will learn how to turn on or off LEDs through a computer and the Serial Monitor. Serial Monitor is used for communication between the Uno board and a computer or other devices.
    It is a built-in software in the Arduino environment and you can click the button on the upper right corner to open it. You can send and receive data via the serial port on the Uno board and control the board by input from the keyboard.
    In this experiment, since we use colored LEDs as loads, you can enter a color among red, green, and blue on Serial Monitor in the IDE. The corresponding LED on the Arduino Uno board will then light up.
    Components
    - 1 * Arduino Uno board
    - 1 * Breadboard
    - 3 * LED
    - 3 * Resistor (220Ω)
    - Jumper wires
    - 1 * USB cable
    Principle
    Here, the Serial Monitor serves as a transfer station for communication between your computer and the Arduino Uno board. First, the computer transfers data to the Serial Monitor, and then the data is read by the Arduino Uno board. Finally, the Uno will perform related operations.
    Experimental Procedures
    Step 1: Build the circuit
    The schematic diagram
    Step 2: Program (Please refer to the example code)
    Step 3: Compile the code
    Step 4: Upload the sketch to the Arduino Uno board
    Now, click the Serial Monitor button at the upper right corner in the IDE.
    Then the Serial Monitor window will pop up as shown below.
    With this window, you can not only send data from your computer to the Arduino Uno board, but also receive data from the board and display it on the screen. When you open the window, it will display "Please input any color of LED:". You can input a color here. If you enter red, green, or blue, click Send, then the corresponding LED on the breadboard will light up. However, if you enter any color other than these three, no LEDs will be on.
    For example, if you input red, you will see the red LED light up.
    Related Searches:
    arduino,arduino uno,buzzer,arduino projects,arduino tutorial,quiz buzzer system,quiz buzzer system using arduino uno,arduino quiz buzzer system,diy quiz buzzer system,arduino quiz buzzer,quiz buzzer,quiz,arduino game show,quiz buzzer sound effect,quiz buzzer circuit,arduino project,arduino quiz game show,arduino quiz show,arduino quiz game show foe beginners,arduino quiz buzzer system code
    Join this channel to get access to perks:
    / @gideonbuniel
    Follow our social media accounts:
    Facebook: / kringgidz
    Facebook: / gideongasulasbuniel
    Website: e-boombots.com/
    Instagram: / gideongbuniel
    Twitter: / kringxg
    Tumbler: www.tumblr.com...
    Pinterest: www.pinterest....
    Linkedin: / gideon-buniel-118bb35a
    Join this channel to get access to perks:
    / @gideonbuniel

КОМЕНТАРІ • 9

  • @angelicap.cajudo4197
    @angelicap.cajudo4197 2 роки тому

    Thank you po malaking help po ang tutorials niyo sa mga activities ko po ☺️

    • @GideonBuniel
      @GideonBuniel  2 роки тому

      you are welcome po kasi hindi ko pa ma continue2 kasi affected po talaga sa odette. internet connection nalang po ang hindi pa naibabalik

  • @adambeedle
    @adambeedle 3 роки тому +1

    Great tutorial 👍

  • @lastchance045
    @lastchance045 Рік тому

    Thank you for the instructions. I have tried your code but have not had full success.
    When I enter red or green or yellow the text is written in the Serial Monitor however
    no LEDs light up !
    Here is the code I used - can you please suggest how I can solve the problem?
    // Open the serial monitor, if you input red, you will see the red LED light up
    const int greenPin = 2; // green led pin attached
    const int yellowPin = 3; // yellow led pin attached
    const int redPin = 4; // red led pin attached
    String comdata = " ";
    int lastLength = 0;
    void setup ()
    {
    pinMode (greenPin, OUTPUT);
    pinMode (yellowPin, OUTPUT);
    pinMode (redPin, OUTPUT);
    Serial.begin (9600);
    Serial.print ("Please input any color of LED:"); // print message on serial monitor
    }
    // if a valid byte is available, read analog ins
    void loop ()
    {
    if (Serial.available() > 0)
    {
    comdata = " ";
    while (Serial.available() > 0)
    {
    comdata += char (Serial.read() ) ;
    delay (2);
    }
    Serial.println (comdata);
    }
    if (comdata == "red")
    {
    digitalWrite (redPin, HIGH); //turn red LED on
    digitalWrite (greenPin, LOW); //turn green LED off
    digitalWrite (yellowPin, LOW); //turn yellow LED off
    }
    else if (comdata == "yellow" )
    {
    digitalWrite (redPin, LOW); //turn red LED off
    digitalWrite (greenPin, LOW); //turn green LED off
    digitalWrite (yellowPin, HIGH); //turn yellow LED on
    }
    else if (comdata == "green" )
    {
    digitalWrite (redPin, LOW); //turn red LED off
    digitalWrite (greenPin, HIGH); //turn green LED on
    digitalWrite (yellowPin, LOW); //turn yellow LED off
    }
    else
    {
    digitalWrite (redPin, LOW); //turn red LED off
    digitalWrite (greenPin, LOW); //turn green LED off
    digitalWrite (yellowPin, LOW); //turn yellow LED off }
    }
    }

  • @boratsagdiyev3936
    @boratsagdiyev3936 Рік тому

    Where is the code for this project?

  • @iverclarencevillamor2005
    @iverclarencevillamor2005 2 роки тому

    Helpful tutorial but I have 1 question. How do you prompt an error text if they types an invalid text
    hope this gets answered

    • @GideonBuniel
      @GideonBuniel  2 роки тому +1

      You add an invalid text prompt inside the code. Serial.print will do.