arduino led tutorial

5
1. Arduino LED Tutorial Step-by-step guide Getting Started Arduino is an open-source platform for building electronics projects. -The components are made of both a physical programmable circuit board ( microcontroller) and the software, or IDE (Integrated Development Environment) that runs on your computer used to write and upload computer code to the physical board. -Download the IDE, -https://www.arduino.cc/en/main/software - -This is what the terminal looks like(Figure1) and from here you can verify and upload code to the Arduino. -Verifying the code means the IDE will compile the file and tell you if there are any errors -A message at the bottom of the screen will tell you if so, you must revise the code before continuing (2) Step 2: -Now that your code is compiled and ready to run plug in your Arduino to your computer with the cable provided(3). -Be sure to put the Arduino on non conductive surfaces(Not on Laptop), the circuit board can get ruined if rubbed on metal, keep on wooden table to be safe. -For this example ill show you how to simply program an LED RGB(Red Blue Green) strip. -In order to do that we need to get something called the FASTLED library, link below, and put the folder into our Arduino source files.(4) -https://github.com/FastLED/FastLED/releases

Upload: others

Post on 02-Jul-2022

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Arduino LED Tutorial

1.

Arduino LED Tutorial

Step-by-step guide

Getting Started

Arduino is an open-source platform for building electronics projects.

 

-The components are made of both a physical programmable circuit board   ( microcontroller) and the software, or IDE (Integrated Development   Environment) that runs on your computer used to write and upload   computer code to the physical board.

-Download the IDE,-https://www.arduino.cc/en/main/software--This is what the terminal looks like(Figure1) and from here you can verify and upload code to the Arduino.-Verifying the code means the IDE will compile the file and tell you if there are any errors-A message at the bottom of the screen will tell you if so, you must revise the code before continuing (2)

 

    

                                                         

 

 

 

 

 

 

 

 

Step 2:

-Now that your code is compiled and ready to run   plug in your Arduino to your computer   with the cable provided(3). 

 

-Be sure to put the Arduino on non conductive   surfaces(Not on Laptop), the circuit   board can get ruined if rubbed on   metal, keep on wooden table to be safe.-For this example ill show you how to simply   program an LED RGB(Red Blue Green)     strip.-In order to do that we need to get something   called the FASTLED library, link below,   and put the folder into our Arduino   source files.(4)

-https://github.com/FastLED/FastLED/releases

Page 2: Arduino LED Tutorial

      

 

Step 3: Installing FASTLED

 

     

-Once you download the Zip file you need to Extract the FastLED3.2.0 file, then add it to the source file of the Arduino IDE, in the libraries folder it should look like this.(4:1,2,3)

 

- Then Edit the file name to just FastLED

Page 3: Arduino LED Tutorial

       

Step 4: FASTLED in Arduino IDE

-Now from here you can open a few preset demos that will command you led strip.

 

-Go to file>Examples>FastLED>ColorPalette

 

-I Chose this preset because it is simple to edit, there are many others that are very versatile so feel free to play around with a few.

     

Page 4: Arduino LED Tutorial

Here is the code that we just pulled up.

 

As you can see it is complex and sometimes hard to follow but all you need to focus on is a few Values.

     1. LED_PIN, this is the pin number your led strip will receive signals from.

     2.Num_LEDS, make sure you know how many LEDS are in your strip and edit that number.

 

Step 7: Wiring 

We must connect our LED strip to the Arduino with a few jumper wires, you will need 3.

 

Now we can connect the strip to the Arduino, I am using WS2812 RGB lights, take your lights and locate the Ground(white wire), 5V(red) and DIN wires(green),                   

 

!!Make sure there are black arrows pointing away from where you connect the lights to the Arduino, this is the flow of the current through the light strip!!

 

Wire the Ground wire to the left side of the board, there are 2 ground pins, either will work

 

Take the 5V pin and insert it on the left side into the 5V slot just next to the GRD

 

Lastly insert your data pin into the 5 slot on the right side of the board as we pointed out in the code before.

 

Page 5: Arduino LED Tutorial

 

 

Step 8: Final Step'

-If everything is correct once you upload your code to the Arduino, a few seconds will go by then it will start to run through the light sequence.

 

-Hope you enjoyed!!!