Results 1 to 2 of 2
  1. #1
    Nintendo Section Moderator PvtRyan's Avatar

    Badge

    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
    Gamer IDs

    PSN ID: gamer_pvtryan Steam ID: pvtryan_cl Wii Code: PvtRyan

    Contact info:

    Youtube Channel: http://www.youtube.com/xPvtRyanx

    Default [Arduino]6 LED Chaser

    Description: LED sequencer casing with quantity of 6.
    Download Link: http://www.mediafire.com/?7x9bk3dp1k7as17
    Code:
    Code:
    const int anode = 9;//LED 1 Pin
    const int anode2 = 8;//LED 2 Pin
    const int anode3 = 6;//LED 3 Pin
    const int anode4 = 4;//LED 4 Pin
    const int anode5 = 3;//LED 5 Pin
    const int anode6 = 2;//LED 6 Pin
    const int cathode = 12;//Cathode for LED Pins
    int ON = HIGH;
    long previousMillis = 0; 
    int OFF = LOW;
    int ledA = LOW;
    int ledB = LOW;
    int ledC = LOW;
    int ledD = LOW;
    int ledE = LOW;
    int ledF = LOW;
    long delayT = 500;  
    
    void setup()
    {
      pinMode(anode, OUTPUT);
      pinMode(anode2, OUTPUT);
      pinMode(anode3, OUTPUT);
      pinMode(anode4, OUTPUT);
      pinMode(anode5, OUTPUT);
      pinMode(anode6, OUTPUT);
      pinMode(cathode, OUTPUT);
    }
    
    void loop()  
    {
      unsigned long currentMillis = millis();  
      if(currentMillis - previousMillis > delayT)
      {
        previousMillis = currentMillis;  
        if( ledA == OFF && ledB == OFF && ledC == OFF && ledD == OFF && ledE == OFF && ledF == OFF || ledA == OFF && ledB == OFF && ledC == OFF && ledD == OFF && ledE == OFF && ledF == ON )
        {
          ledA = ON;
          ledB = OFF;
          ledC = OFF;
          ledD = OFF;
          ledE = OFF;
          ledF = OFF;
        }
        else if( ledA == ON && ledB == OFF && ledC == OFF && ledD == OFF && ledE == OFF && ledF == OFF )
        {
          ledA = OFF;
          ledB = ON;
          ledC = OFF;
          ledD = OFF;
          ledE = OFF;
          ledF = OFF;
        }
        else if( ledA == OFF && ledB == ON && ledC == OFF && ledD == OFF && ledE == OFF && ledF == OFF )
        {
          ledA = OFF;
          ledB = OFF;
          ledC = ON;
          ledD = OFF;
          ledE = OFF;
          ledF = OFF;
        }
        else if( ledA == OFF && ledB == OFF && ledC == ON && ledD == OFF && ledE == OFF && ledF == OFF )
        {
          ledA = OFF;
          ledB = OFF;
          ledC = OFF;
          ledD = ON;
          ledE = OFF;
          ledF = OFF;
        }
        else if( ledA == OFF && ledB == OFF && ledC == OFF && ledD == ON && ledE == OFF && ledF == OFF )
        {
          ledA = OFF;
          ledB = OFF;
          ledC = OFF;
          ledD = OFF;
          ledE = ON;
          ledF = OFF;
        }
        else if( ledA == OFF && ledB == OFF && ledC == OFF && ledD == OFF && ledE == ON && ledF == OFF )
        {
          ledA = OFF;
          ledB = OFF;
          ledC = OFF;
          ledD = OFF;
          ledE = OFF;
          ledF = ON;
        }
        
        digitalWrite(anode, ledA);
        digitalWrite(anode2, ledB);
        digitalWrite(anode3, ledC);
        digitalWrite(anode4, ledD);
        digitalWrite(anode5, ledE);
        digitalWrite(anode6, ledF);
        digitalWrite(cathode, LOW);  
      }
    }
    Proof Video

    0 Not allowed! Not allowed!


    PS4 Profile:

  2. #2
    Desu Development
    Pomf pomf :3
    Fuck Sky's Avatar
    Join Date
    Sep 2013
    Location
    WOW ANIME MAN WOW
    Posts
    1,137
    Points
    1,687
         User Info     Contact     Gamer ID
    Join Date
    Sep 2013
    Location
    WOW ANIME MAN WOW
    Posts
    1,137
    Points
    1,687
    Gamer IDs

    Gamertag: Hexpresso PSN ID: WideDongWeary Steam ID: twitchhexpresso

    Contact info:

    Youtube Channel: http://www.youtube.com/ Kik Username: Wownicehack

    Default

    Just checking states of booleans and a simple if statement turning them on and off...?

    Why..?

    0 Not allowed! Not allowed!
    geadszf1231qewrg

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 02:39 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.