0% found this document useful (0 votes)
440 views6 pages

LED Trailing Effects V2.0

This document summarizes an example that shows 8 LED trailing effects using Arduino. It includes a parts list of hardware required, schematics of the circuit connection, sample code to turn the LEDs on and off in sequence, and an example picture of the trailing light effect. The code uses for loops and digitalWrite to toggle each LED pin on the Arduino board from high to low with a 200ms delay, creating a trailing light pattern across the LEDs.

Uploaded by

testscribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
440 views6 pages

LED Trailing Effects V2.0

This document summarizes an example that shows 8 LED trailing effects using Arduino. It includes a parts list of hardware required, schematics of the circuit connection, sample code to turn the LEDs on and off in sequence, and an example picture of the trailing light effect. The code uses for loops and digitalWrite to toggle each LED pin on the Arduino board from high to low with a 200ms delay, creating a trailing light pattern across the LEDs.

Uploaded by

testscribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LED trailing effects

Overview

This example shows 8 LED trailing effects.

Specification

za
ra

Pin definition
sm

LED
Long pin
Short pin

Hardware required
Material diagram Material name Number
220/330Ω resistor 6
LED 6

USB Cable 1

UNO R3 1

Breadboard 1

Jumper wires Several

1
Connection

Schematic

za
ra
sm

2
Connection diagram

za
ra
sm

Note:The longest LED of the pin is connected to the digital signal port *(D*).

3
Sample code
Note : sample code under the Sample code folder

int BASE = 2;
int NUM = 6;
void setup()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
pinMode(i, OUTPUT); //set port ‘i’ as an output port
}
}
void loop()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
digitalWrite(i, LOW);
delay(200);
}
za
for (int i = BASE; i < BASE + NUM; i ++)
{
digitalWrite(i, HIGH);
ra

delay(200);
}
sm

4
Example picture

za
ra
sm

5
Language reference
Tips:click on the following name to jump to the web page.
If you fail to open, use the Adobe reader to open this document.
int
pinMode()
OUTPUT
for()
HIGH
LOW
digitalWrite()
delay()

Application effect
You'll see all the LEDs will turn on/off regularly.

za
******************************************************************************************
* About Smraza:
ra

* We are a leading manufacturer of electronic components for Arduino and Raspberry


Pi.
sm

* Official website: http://www.smraza.com/


* We have a professional engineering team dedicated to providing tutorials and
support to help you get started.
* If you have any technical questions, please feel free to contact our support staff via
email at support@smraza.com
* We truly hope you enjoy the product, for more great products please visit our
Amazon US store: http://www.amazon.com/shops/smraza
Amazon CA store: https://www.amazon.ca/shops/AMIHZKLK542FQ
Amazon UK store: http://www.amazon.co.uk/shops/AVEAJYX3AHG8Q
Amazon DE store: http://www.amazon.de/shops/AVEAJYX3AHG8Q
Amazon FR store: http://www.amazon.fr/shops/AVEAJYX3AHG8Q
Amazon IT store: http://www.amazon.it/shops/AVEAJYX3AHG8Q
Amazon ES store: https://www.amazon.es/shops/AVEAJYX3AHG8Q
******************************************************************************************

You might also like