Mar 112012
 

Made some running LEDs to have something quick and fun to show my kids.
This is what it looked like. I am using the even numbered digital outputs, connected to a LED with a 220 ohm resistor to ground.

They really liked it. When I first set it up, I only used red LEDs, but they wanted me to switch to what is shown in the picture.

Here is a short video of the live action :-), FunWithLEDs

The programming was intense, not! It is a really easy thing to use Arduino with its IDE and all help and examples available.

This is what the coding ended up in.

/*
  Fun with LEDs
 */

int pin;

void setup() {                
  // initialize the digital pins as output.
  for (pin=0; pin < 13; pin++) {
    pinMode(pin, OUTPUT);     
  }
}

void loop() {
  for (pin=0; pin < 13; pin++) {
    digitalWrite(pin, HIGH);   // set the LED on
    delay(30);              // wait
    digitalWrite(pin, LOW);    // set the LED off
    delay(30);              // wait
  }    
}

That's it! I am not sure what the next project will be. Either a Display project, or a HomeAutomation project controlling some Nexa power outlet switches.

 

  One Response to “Arduino project – Fun with LEDs”

  1. This is very interesting, You are a very skilled blogger.
    I have joined your feed and look forward to seeking
    more of your fantastic post. Also, I’ve shared your
    website in my social networks!

Sorry, the comment form is closed at this time.