Introduction to LED
Introduction to Arduino
In this project we’re going to introduce you to some hardware components that are essential for turning led (light emitting diode) ON and OFF and its connections. And also learn how to control them by turning the led ON and OFF (blink) by using card bricks.
KIT: Junkbot Edu kit.
- Arduino Uno
- USB cable
- Connecting wires
Code brick program:
The program can be depicted on the hardwire as illustrated below.
- Connecting LED to Arduino Uno:
- Use the USB cable for connecting the Arduino Uno with laptop.
- The LED consists of positive (red wire) and negative (black wire) ends.
- Connect the positive (red wire) to 5V and negative (black wire) to GND pf the Arduino Uno.
- This configuration help you’re led to ON.
Here in this case we can just test whether the led is working or not in order to control and blink the led there is a different approach which is explained below.
- Controlling an LED:
- To control an LED, take a functional LED you can that by testing it:
- Connect the red wire to pin 13 on Arduino and black wire to GND on Arduino.
- Connect the Arduino to your laptop using the USB cable.
- Open card bricks, click the events block.
- Click the control block and connect to it.
- Click the robot and insert in it . Change 9 to
- Save the code as LED1.
- This program will turn on the led which is connected to pin 13 when you click the in codebricks.
- Connect the USB cable to arduino and laptop.
- Go to BOARDS and select arduino uno
- Go to CONNECT and select the usb port and wait until it says serial port connected.
- The dot will turn from red to green, representing the connection established.
- Once port is connected upgrade the firmware and wait until it uploads .
- Now press you can see you’re led glowing (ON state).
- Blink: In the previous case, once you click the green flag the led will go on and it will stay like till you give power supply. To make it blink, you need to add more blocks of code.
- Open the previous code.
- Go to control and add to the code.
- Make a right click or cmd+click on and duplicate the code.
- Add it to the code.
- Now modify code as illustrated.
- By clicking the , the led will turn on for one second and turn off for one second. In other words, the led will blink.
- Establishing connection:
- Even though you connected Arduino to your computer, it won’t start communicating with codebricks until you connect them manually. Repeat from Step 10 to establish connection
- Lectures 0
- Quizzes 0
- Duration 50 hours
- Skill level All level
- Language English
- Students 3
- Certificate No
- Assessments Self