First steps with Arduino and LEDs

LED Activation and SOS Command with Arduino

Here I will start presenting the first part of our project with ARDUINO, made together with Ivan Gonzalez

We will first start with the materials used for the first things done:

  • A protoboard
  • Programmable chip: ESP 8266 MOD
  • Some black and red wires
  • Resistors
  • LEDs
  • An USB connector
  • Now before starting programming, we will need to download some stuff to our computer:

  • We download Arudino IDE or Visual Studio Code to setup the code, we will be using Arduino IDE now
  • Inside Arduino IDE, we download the configuration of our protoboard and programmable chip, in our case ESP8266
  • If we use Visual Studio Code, we will need to download Expresif-IDF and PlatformIO IDE as extensions
  • For the drivers, we will go the the principal page of ESP-32 and download the last drivers of our chip, and then in our computer configuration we will activate them with our chip
  • Now we can start working with Arduino IDE

    First we should test if everything is alright, and we can do this with one of the blinking examples given in Arduino. If everything it's setup well, our LED should blink in differents periods wich we can control

    Now we will try to do the morse code, the main command we used in Arduino it's this one:

    Here I made a video showing how this command is running:

    Explanation of the code:

    In the first command we need to say to the code in which Pin we put our wire, in my case 5. Then we now divide the code in two parts:

    Void Setup: This is the part of the code that activates at the start just one time. Here, after saying the ledPin was an output, we made an array and put the patern of flashes for the letter S and O

    Void Loop: This is the part of the code that stays always activated in loop. Here we call the S and O arrays made in the Setup to run in loop, putting delays sometimes between them if the flashes run too much fast

    Finally, we create Flash, which is the part where we will configurate the flash command to activate/desactivate our LED whenever we call it

    Anyways, there are other ways to run this as maybe the last one doesn't work for you, so here are other tested SOS codes for Arduino:

    The second one is a more closed code that doesn't let you really modify it a lot, as you will call directly the Flash in the loop, saying when will it turn on or of, and how much time will it last, without using arrays

    The third it's a bit more open as you will firstly create the value of the Long and Short duration of each flash, which is 200 for short and 600 for long. Then after setting the Pin, we will call the S, O and again the S putting directly creating a void (which here is LetterSequence) which makes the led to turn on and of and then, in the loop, you will put this void and also adding delays saying if the duration is Short or Long. If you know all the morse code, you could use all this Short and Long to create all the words for exampl