Saturday, 13 October 2018

LED CHASER USING ARDUINO NANO


BY 
 ABHIJITH

WHAT IS ARDUINO?


Arduino is a popular open-source development board for engineers and makers to develop electronics projects in an easy way. It consists of both a physical programmable development board (based onAVR series of microcontrollers) and a piece of software or IDE which runs on your computer and used to write and upload the code to the microcontroller board.
Explore below some interesting arduino projects and tutorials based on different types of arduino baords like Arduino Uno, Arduino Pro Mini, etc. These DIY arduino projects for beginners are explained well and you can find the complete guide to DIY these projects with the help of circuit diagrams, source codes and videos. You can also browse below pages to get new arduino project ideas.


MATERIALS REQUIRED?

ARDUINO UNO 
LED 12 NOS
PCB OR BREAD BOARD
WIRE PIECE

CONNECTION DIAGRAM

Dual LED Chaser Arduino Project Breadboard Layout

CODES

//---------------------------------------------------------------------
//  Program:      dual_chaser
//
//  Description:  12 LED dual chaser. One led moves from left to right
//                while the second LED moves from right to left.
//                LEDs and series resistors connected to pins 2 to 13.
//
//  Date:         8 April 2016      Author: ABHIJITH
//http://diymalayalamtechforyou.blogspot.com/2018/10/led-chaser-using-arduino-nano.html
//---------------------------------------------------------------------

// change speed of display here
#define SPEED_MS  100

void setup() {
  // set up pins 2 to 13 as outputs
  for (int i = 2; i <= 13; i++) {
    pinMode(i, OUTPUT);
  }
}

uint16_t chase2 = 13; // keeps track of second LED movement

void loop() {
  // move first LED from left to right and second from right to left
  for (int i = 2; i < 13; i++) {
    allLEDsOff();
    digitalWrite(i, HIGH);      // chaser 1
    digitalWrite(chase2, HIGH); // chaser 2
    chase2--;
    // stop LEDs from appearing to stand still in the middle
    if (chase2 != 7) {
      delay(SPEED_MS);
    }
  }

  // move first LED from right to left and second LED from left to right
  for (int i = 13; i > 2; i--) {
    allLEDsOff();
    digitalWrite(i, HIGH);      // chaser 1
    digitalWrite(chase2, HIGH); // chaser 2
    chase2++;
    // stop LEDs from appearing to stand still in the middle
    if (chase2 != 8) {
      delay(SPEED_MS);
    }
  }
}

// function to switch all LEDs off
void allLEDsOff(void)
{
  for (int i = 2; i <= 13; i++) {
    digitalWrite(i, LOW);
  }
}

COPY MESSAGE 


DIY MALAYALAM TECH FOR YOU



Cat : Arduino For Begineers

LED CHASER MULTI FUNCTION