Blinking LED
Introduction
LED is usually used in office lighting, furniture, decoration, sign board, streetlight, etc.
Components
– 1 * Adeept Arduino UNO R3 Board
– 1 * LED Module
– 1 * USB Cable
– 1 * 3-Pin Wires
Experimental Principle
The Fritzing images:
Pin definition:
The schematic diagram:
In this experiment, we make the pin D8 of the Arduino board output High/Low by programming, to control the LED to blink in a certain frequency.
Experimental Procedures
Step 1: Build the circuit
Step 2: Program
/***********************************************************
File name: _01_LEDModule.ino
Description: Lit LED, let LED blinks.
Website: www.adeept.com
E-mail: support@adeept.com
Author: Tom
Date: 2017/07/12
***********************************************************/
int ledPin=8; //definition digital 8 pin to control the LED module
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(500); //Set the delay time, 500 = 0.5S
digitalWrite(ledPin,LOW); //LOW is set to about 5V PIN8
delay(500); //Set the delay time, 500 = 0.5S
}
Step 3: Compile and download the sketch to the UNO R3 board.
Connect the Arduino UNO R3 board to the PC. Select Tool -> Board “Arduino/Genuino Uno”, and Port – > COM3. Also here is COM3, assigned to the Uno, but it can be COM1, COM2, COM3…
Now you can see the LED on the LED module blinks once per second.