Git Product home page Git Product logo

3x3x3-led-cube-arduino's Introduction

3x3x3-LED-Cube-Project

Gif Demonstration of The 3x3x3 LED Cube

Check Out The Full Video Here:

https://www.youtube.com/watch?v=daINgAoS91E

The Code:

void setup()
{
    for (int i=0;i<11;i++)
    {
        pinMode(i,OUTPUT);    // PINS0-10 are set as output
    }
    pinMode(A0,OUTPUT);    //PIN A0 set as output
    pinMode(A1,OUTPUT);   // PIN A1 set as output
    pinMode(A2,OUTPUT);   // PIN A2 set as output
    
    digitalWrite(A0,HIGH);    //pull up the A0 pin
    digitalWrite(A1,HIGH);   // pull up the A1 pin
    digitalWrite(A2,HIGH);   // pull up the A2 pin

      /* add setup code here, setup code runs once when the processor starts */

}

void loop()
{
        digitalWrite(A0,LOW);    //layer 1 of cube is grounded
          for (int i=2;i<11;i++)
          {
              digitalWrite(i,HIGH);    //turn ON each LED one after another in layer1
              delay(200);
                delay(200);
                  delay(200);
            digitalWrite(i,LOW);
          }
        digitalWrite(A0,HIGH);    //layer1 is pulled up
          
          digitalWrite(A1,LOW);   // layer 2 of cube is grounded
          for (int i=2;i<11;i++)
          {
              digitalWrite(i,HIGH);   // turn ON each LED one after another in layer2
                            delay(200);
                            delay(200);
                            delay(200);
              digitalWrite(i,LOW);
          }
        digitalWrite(A1,HIGH);    // layer2 is pulled up
          
        digitalWrite(A2,LOW);    // layer 3 of cube is grounded
        for (int i=2;i<11;i++)
        {
            digitalWrite(i,HIGH);    // turn ON each LED one after another in layer3
                          delay(200);
                          delay(200);
                          delay(200);
            digitalWrite(i,LOW);
        }
        digitalWrite(A2,HIGH);    // layer3 is pulled up

}

3x3x3-led-cube-arduino's People

Contributors

dennisoconnell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.