led_array

Upload: gui9871

Post on 03-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 led_array

    1/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    0 Tweet 0

    Search

    topics

    android app

    arduino

    code

    do it yourself

    Extra

    gadgets

    hacking gadgets

    just looking

    my projects

    Software

    0Like Share

    Simple Christmas Light Effects With

    Arduino

    Posted on November 13, 2012by admin

    ...

    Thisis an eight LEDs Christmas Light effect using Gizduino X

    mounted on Universal MCU Trainer Rev 1.1. The whole code is

    divided to seven parts in which each part show different blinking

    effects.

    PLAYING WITH LEDS

    Home Arduino Tutorials About Me

    http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://pdfcrowd.com/customize/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2F&text=Simple%20Christmas%20Light%20Effects%20With%20Arduino%20%7C%20Luntian%20Laboratory&tw_p=tweetbutton&url=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2Fhttp://www.luntianlaboratory.com/http://www.luntianlaboratory.com/arduino-tutorials/http://www.luntianlaboratory.com/about/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttps://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2F&text=Simple%20Christmas%20Light%20Effects%20With%20Arduino%20%7C%20Luntian%20Laboratory&tw_p=tweetbutton&url=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2Fhttp://twitter.com/search?q=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2Fhttp://www.luntianlaboratory.com/category/android-app/http://www.luntianlaboratory.com/category/arduino/http://www.luntianlaboratory.com/category/code/http://www.luntianlaboratory.com/category/diy/http://www.luntianlaboratory.com/category/extra/http://www.luntianlaboratory.com/category/gadgets/http://www.luntianlaboratory.com/category/hacking/http://www.luntianlaboratory.com/category/byte/http://www.luntianlaboratory.com/category/projects/http://www.luntianlaboratory.com/category/software/http://www.luntianlaboratory.com/code/dancing-led-array/http://www.luntianlaboratory.com/author/admin/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/arduino-tutorials/http://www.luntianlaboratory.com/about/
  • 8/12/2019 led_array

    2/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    recent art ic les

    Intel RST for Cooler Platform

    Controller Hub (PCH)

    I Installed a Lincensed ESET

    NOD32 Antivirus!The Tale of Impulsive Upgrader |

    From Windows.3x to Windows 8

    / 8.1

    Bluetooth File Transfer Protocol

    Version 2

    Blocking The Globe Tattoo

    Ghost Web Icon

    A Laptop Cooling Pad Test

    Problem Solving | Bluetooth File

    Transfer from Android Phone to

    PC

    recent comments

    Xcharleson The Unexpected

    Globe Tattoo 800MB Data Limit

    adnan adam on The Huawei

    Mobile Pocket Wifi E5220

    void setup() {

    // initialize the LED pins:

    // the array method of initializing led pins

    // it means led 2, 3, 4, 5, 6, 7, 8 and 9

    // are set

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    pinMode(thisPin, OUTPUT);

    }

    // it is the same as

    // int 2 = 2;

    // int 3 = 3;

    // int 4 = 4;

    // int 5 = 5;

    // int 6 = 6;

    // int 7 = 7;

    // int 8 = 8;

    // int 9 = 9;

    // then

    // pinMode(2,OUTPUT);

    // pinMode(3,OUTPUT);

    // pinMode(4,OUTPUT);

    // pinMode(5,OUTPUT);

    // pinMode(6,OUTPUT);

    // pinMode(7,OUTPUT);

    // pinMode(8,OUTPUT);

    // pinMode(9,OUTPUT);

    }

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttp://www.luntianlaboratory.com/gadgets/intel-rst-cool-pch/http://www.luntianlaboratory.com/software/licensed-eset-nod32/http://www.luntianlaboratory.com/extra/from-windows-95-to-windows-8/http://www.luntianlaboratory.com/android-app/bftp-2-tutorial/http://www.luntianlaboratory.com/extra/globe-tattoo-ghost-icon/http://www.luntianlaboratory.com/gadgets/laptop-cooling-pad/http://www.luntianlaboratory.com/extra/bluetooth-flie-transfer/http://a/http://www.luntianlaboratory.com/extra/globe-tattoo-800-mb-limit/#comment-2699http://www.luntianlaboratory.com/gadgets/huawei-e5220-pocket-wifi/#comment-2695http://www.luntianlaboratory.com/gadgets/huawei-e5220-pocket-wifi/#comment-2687
  • 8/12/2019 led_array

    3/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    Pocket Wifi E5220

    admin on The Huawei Mobile

    Pocket Wifi E5220

    Nico on The Huawei Mobile

    Pocket Wifi E5220

    tags

    androidarduinobatterycameracomputerddwrt

    electricityepsonfanfreedom

    planglobehard diskhard

    drivehuaweiinternet

    laptoplcdldrledledslinux

    mmorpgmotormp3phone

    potentiometerpower supplypsu

    push buttonqosroutersamsung

    sd cardseven segmentssmartsony

    stepper motorsun cellular

    tattootoshibausbwifi

    // CREATING DIFFERENT COMBINATIONS TO RENDER DIF

    void loop() {

    // combination 1: BLINK ALL LEDS SEVERAL TIMES

    // Sure there are shorter way of doing

    // this, the "for loop" statement.

    digitalWrite(2, HIGH);

    digitalWrite(3, HIGH);

    digitalWrite(4, HIGH);

    digitalWrite(5, HIGH);

    digitalWrite(6, HIGH);

    digitalWrite(7, HIGH);

    digitalWrite(8, HIGH);

    digitalWrite(9, HIGH);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, LOW);

    digitalWrite(4, LOW);

    digitalWrite(5, LOW);

    digitalWrite(6, LOW);

    digitalWrite(7, LOW);

    digitalWrite(8, LOW);digitalWrite(9, LOW);

    delay(500);

    digitalWrite(2, HIGH);

    digitalWrite(3, HIGH);

    digitalWrite(4, HIGH);

    digitalWrite(5, HIGH);

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttp://www.luntianlaboratory.com/gadgets/huawei-e5220-pocket-wifi/#comment-2687http://www.luntianlaboratory.com/gadgets/huawei-e5220-pocket-wifi/#comment-2685http://www.luntianlaboratory.com/gadgets/huawei-e5220-pocket-wifi/#comment-2683http://www.luntianlaboratory.com/tag/android/http://www.luntianlaboratory.com/tag/arduino/http://www.luntianlaboratory.com/tag/battery/http://www.luntianlaboratory.com/tag/camera/http://www.luntianlaboratory.com/tag/computer/http://www.luntianlaboratory.com/tag/ddwrt/http://www.luntianlaboratory.com/tag/electricity/http://www.luntianlaboratory.com/tag/epson/http://www.luntianlaboratory.com/tag/fan/http://www.luntianlaboratory.com/tag/freedom-plan/http://www.luntianlaboratory.com/tag/globe/http://www.luntianlaboratory.com/tag/hard-disk/http://www.luntianlaboratory.com/tag/hard-drive/http://www.luntianlaboratory.com/tag/huawei/http://www.luntianlaboratory.com/tag/internet/http://www.luntianlaboratory.com/tag/laptop/http://www.luntianlaboratory.com/tag/lcd/http://www.luntianlaboratory.com/tag/ldr/http://www.luntianlaboratory.com/tag/led/http://www.luntianlaboratory.com/tag/leds/http://www.luntianlaboratory.com/tag/linux/http://www.luntianlaboratory.com/tag/mmorpg/http://www.luntianlaboratory.com/tag/motor/http://www.luntianlaboratory.com/tag/mp3/http://www.luntianlaboratory.com/tag/phone/http://www.luntianlaboratory.com/tag/potentiometer/http://www.luntianlaboratory.com/tag/power-supply/http://www.luntianlaboratory.com/tag/psu/http://www.luntianlaboratory.com/tag/push-button/http://www.luntianlaboratory.com/tag/qos/http://www.luntianlaboratory.com/tag/router/http://www.luntianlaboratory.com/tag/samsung/http://www.luntianlaboratory.com/tag/sd-card/http://www.luntianlaboratory.com/tag/seven-segments/http://www.luntianlaboratory.com/tag/smart/http://www.luntianlaboratory.com/tag/sony/http://www.luntianlaboratory.com/tag/stepper-motor/http://www.luntianlaboratory.com/tag/sun-cellular/http://www.luntianlaboratory.com/tag/tattoo/http://www.luntianlaboratory.com/tag/toshiba/http://www.luntianlaboratory.com/tag/usb/http://www.luntianlaboratory.com/tag/wifi/
  • 8/12/2019 led_array

    4/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    windowswirewordpress,

    digitalWrite(7, HIGH);

    digitalWrite(8, HIGH);

    digitalWrite(9, HIGH);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, LOW);

    digitalWrite(4, LOW);digitalWrite(5, LOW);

    digitalWrite(6, LOW);

    digitalWrite(7, LOW);

    digitalWrite(8, LOW);

    digitalWrite(9, LOW);

    delay(500);

    digitalWrite(2, HIGH);

    digitalWrite(3, HIGH);

    digitalWrite(4, HIGH);

    digitalWrite(5, HIGH);

    digitalWrite(6, HIGH);

    digitalWrite(7, HIGH);

    digitalWrite(8, HIGH);

    digitalWrite(9, HIGH);

    // combination 2: ALTERNATE

    digitalWrite(2, HIGH);

    digitalWrite(3, LOW);

    digitalWrite(4, HIGH);

    digitalWrite(5, LOW);

    digitalWrite(6, HIGH);

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttp://www.luntianlaboratory.com/tag/windows/http://www.luntianlaboratory.com/tag/wire/http://www.luntianlaboratory.com/tag/wordpress/
  • 8/12/2019 led_array

    5/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    digitalWrite(7, LOW);

    digitalWrite(8, HIGH);

    digitalWrite(9, LOW);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, HIGH);

    digitalWrite(4, LOW);

    digitalWrite(5, HIGH);

    digitalWrite(6, LOW);

    digitalWrite(7, HIGH);

    digitalWrite(8, LOW);

    digitalWrite(9, HIGH);

    digitalWrite(2, HIGH);

    digitalWrite(3, LOW);

    digitalWrite(4, HIGH);

    digitalWrite(5, LOW);

    digitalWrite(6, HIGH);

    digitalWrite(7, LOW);

    digitalWrite(8, HIGH);

    digitalWrite(9, LOW);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, HIGH);

    digitalWrite(4, LOW);

    digitalWrite(5, HIGH);

    digitalWrite(6, LOW);

    digitalWrite(7, HIGH);

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdf
  • 8/12/2019 led_array

    6/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    digitalWrite(8, LOW);

    digitalWrite(9, HIGH);

    // combination 3: BY TWOS

    digitalWrite(2, HIGH);

    digitalWrite(3, HIGH);

    digitalWrite(4, LOW);

    digitalWrite(5, LOW);

    digitalWrite(6, HIGH);

    digitalWrite(7, HIGH);

    digitalWrite(8, LOW);

    digitalWrite(9, LOW);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, HIGH);

    digitalWrite(4, HIGH);

    digitalWrite(5, LOW);

    digitalWrite(6, LOW);

    digitalWrite(7, HIGH);

    digitalWrite(8, HIGH);

    digitalWrite(9, LOW);delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, LOW);

    digitalWrite(4, HIGH);

    digitalWrite(5, HIGH);

    digitalWrite(6, LOW);

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdf
  • 8/12/2019 led_array

    7/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    digitalWrite(7, LOW);

    digitalWrite(8, HIGH);

    digitalWrite(9, HIGH);

    delay(500);

    digitalWrite(2, LOW);

    digitalWrite(3, HIGH);

    digitalWrite(4, HIGH);

    digitalWrite(5, LOW);

    digitalWrite(6, LOW);

    digitalWrite(7, HIGH);

    digitalWrite(8, HIGH);

    digitalWrite(9, LOW);

    delay(500);

    // The next set of codes use arrays to control

    // the LED behavior

    // combination 4:RUNS FORWARD AND BACKWARD

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, HIGH);

    delay (70);}

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, HIGH);

    delay(70);

    }

    for (int thisPin = 9; thisPin > 1; thisPin--) {

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdf
  • 8/12/2019 led_array

    8/11

    pdfcrowd comopen in browser PRO version Are you a developer? Try out the HTML to PDF API

    digitalWrite(thisPin, LOW);

    delay(70);

    }

    // combination 5: BLINKING ON FORWARD AND BACKWA

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, HIGH);

    delay (70);

    digitalWrite(thisPin, LOW);

    delay (70);

    }

    // combination 6: BLINKING ON FORWARD AND BACKWA

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, HIGH);

    delay (70);

    digitalWrite(thisPin, LOW);

    delay (70);

    digitalWrite(thisPin, HIGH);

    delay (70);

    }

    // combination 7: ANOTHER SET

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, LOW);

    delay (100);

    }

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdf
  • 8/12/2019 led_array

    9/11

    df d mi b PRO i Are you a developer? Try out the HTML to PDF API

    for (int thisPin = 2; thisPin < 10; thisPin++) {

    digitalWrite(thisPin, LOW);

    delay (100);

    }

    }

    RELATED POSTS

    1. Arduino Tutorial Series The On-board Blinking LED

    2. Playing LEDs, Button and Buzzer With Arduino

    3. The US-100 Ultrasonic Distance Sensor Arduino Demo

    Code

    4. Arduino Tutorial Series ON LED After A Button Push

    ...

    0 Tweet 0

    This entry was posted in codeand tagged dancing led arrayby admin.

    Bookmark the permalink.

    0Like Share

    Leave a Reply

    Your email address will not be published. Required fields are

    marked *

    http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttps://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2F&text=Simple%20Christmas%20Light%20Effects%20With%20Arduino%20%7C%20Luntian%20Laboratory&tw_p=tweetbutton&url=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2Fhttp://twitter.com/search?q=http%3A%2F%2Fwww.luntianlaboratory.com%2Fcode%2Fdancing-led-array%2Fhttp://www.luntianlaboratory.com/arduino/on-board-blinking-led/http://www.luntianlaboratory.com/code/play-button-leds-buzzer/http://www.luntianlaboratory.com/code/us-100-distance-sensor/http://www.luntianlaboratory.com/arduino/on-led-after-push-button/http://www.luntianlaboratory.com/category/code/http://www.luntianlaboratory.com/tag/dancing-led-array/http://www.luntianlaboratory.com/author/admin/http://www.luntianlaboratory.com/code/dancing-led-array/
  • 8/12/2019 led_array

    10/11

    df di b PRO i Are you a developer? Try out the HTML to PDF API

    Post Comment

    Name *

    Email

    *

    Website

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdf
  • 8/12/2019 led_array

    11/11

    df di b PRO i A d l ? T t th HTML t PDF API

    Playing LEDs, Button and Buzzer With Arduino

    The US-100 Ultrasonic Distance Sensor Arduino Demo

    Code

    by luntianlaboratory.com 2010-2012see change log, site rules & stuff

    posts with pictures of luntiancorner.com were moved articles. they are owned by the same author

    http://pdfcrowd.com/http://pdfcrowd.com/redirect/?url=http%3a%2f%2fwww.luntianlaboratory.com%2fcode%2fdancing-led-array%2f&id=ma-140224192934-ac9aff40http://pdfcrowd.com/customize/http://pdfcrowd.com/html-to-pdf-api/?ref=pdfhttp://www.luntianlaboratory.com/code/play-button-leds-buzzer/http://www.luntianlaboratory.com/code/us-100-distance-sensor/http://www.luntianlaboratory.com/http://www.luntianlaboratory.com/about/http://www.luntianlaboratory.com/about/