Blinking LED with Maddy Board
Overview:
In this lesson, we will start the journey of learning about programming with controller.
To begin, let's learn how to make an LED blink.
Components:
1.?????Maddy board
2.?????USB Cable
3.?????Resistor
4.?????LED
5.?????Breadboard
6.?????Jumper Wires
Principle:
In this lesson, we will program the Arduino's GPIO output high level (+5V) and low level (0V), and then make the LED which is connected to the Arduino’s GPIO flicker with a certain frequency.
What is the LED?
The LED is the abbreviation of light emitting diode. It is usually made of gallium arsenide, gallium phosphide semiconductor materials. The LED has two electrodes: a positive electrode and a negative one. It lights up only when a forward current passes, and it can flash red, blue, green, yellow, etc. The color of the light depends on the material it is made.
What is resistor?
The main function of the resistor is to limit currents. In the circuit, the character ‘R’ represents resistor, and the unit of resistor is ohm (Ω).
A band resistor is used in this experiment. It is a resistor with a surface coated with some particular color through which the resistance can be identified directly.
Procedure:
Step 1: Build the circuit.
Step 2: Program
Blinking LED Code
int ledPin=8; //definition digital 8 pins as pin to control the LED
void setup()
{
???pinMode(ledPin,OUTPUT);???//Set the digital 8 port mode, OUTPUT: Output mode
}
void loop()
{?
???digitalWrite(ledPin,HIGH); //HIGH is set to about 5V PIN8
???delay(1000);??????????????//Set the delay time, 1000 = 1S
???digitalWrite(ledPin,LOW);?//LOW is set to about 5V PIN8
???delay(1000);??????????????//Set the delay time, 1000 = 1S
}
Step 3: Compile the program and upload to Arduino UNO board. Now you can see the LED blinking