Archive for the 'Us Arduino' Category
Matthew Reed- Sharing the light

My arduino project is two differnt leds alternating back and forth.

 void setup() {
pinMode(green, OUTPUT);
pinMode(red, OUTPUT);
Serial.begin(9600);
}

void loop() {
if (Serial.available()) {
val = Serial.read();
}
if (val == ‘H’) {
   digitalWrite(green, HIGH);
   digitalWrite(red,LOW);
}else{
if (val == ‘L’) {
   digitalWrite(red, HIGH);
  }
}
}

Ali Kazi’s Airport Runway Lights

For some reason my post wont show up in Us Arduino category. In fact, I cant see it in any category. Its there somewhere on the internet and I ve managed to get that somewhere’s link. So here’s my Us Arduino project.

http://cratel.wichita.edu/blogs/engr101fall2010/2010/10/29/arduino-and-leds/

Miguel Correa- Just flashing LED’s

For my arduino project I made some LED’s light up in a sequence. I didn’t make the program code or the project to difficult because I am still in the process of learning the C-language used. In this project the code I used is not that different from that of the ”blink” example it just has some repetition and stuff.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);

pinMode(10, OUTPUT);

pinMode(9, OUTPUT);

}

void loop() {
  digitalWrite(13, HIGH); // set the LED on
  delay(100);             // wait for a second
  digitalWrite(13, LOW);     // set the LED off
  delay(100);                // wait for a second
  digitalWrite(12, HIGH); // set the LED on
  delay(1000);            // wait for a second
  digitalWrite(12, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(11, HIGH); // set the LED on
  delay(100);             // wait for a second
  digitalWrite(11, LOW);    // set the LED off
  delay(1000);              // wait for a second

digitalWrite(10, HIGH); // set the LED on
  delay(1000);             // wait for a second
  digitalWrite(10, LOW);    // set the LED off
  delay(100);              // wait for a second

digitalWrite(9, HIGH); // set the LED on
  delay(100);             // wait for a second
  digitalWrite(9, LOW);    // set the LED off
  delay(100);              // wait for a second

}

Prabhjit’s Arduino light show – Pitbul song – “I know you want me”

Alright guys so I decided on making a light show with 6 led lights to start with. Then while listening to music while writing my code I came up with an idea of making the led lights change according to the beat of the music of the song.

I chose Pitbul’s – “I know you want me” song:   http://www.youtube.com/watch?v=BNoyhtovGHE

The LED’s on my arduino light on and off according the the beat of the song.

Heres my video:

YouTube Preview Image

Here’s my code: Pitbul___I_know_u_want_me___Arduino

Trevor Brand-short dice

I had a really hard time deciding what to do this time but i ended up going with a program that simply creates two sets of random numbers and displays them with 12 leds.I am going to slow it down a bit so that the leds stay on longer before i get off.

dice

Light show___ Faris
This is my light show I use a 12 lights and and used a wire
and I hocke it up with the wire ,,, it is very simple but took me long
time to the pain,,, this is all about my Light show,,,,,,.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH);   // set the LED on
delay(1000);              // wait for a second
digitalWrite(2, LOW);    // set the LED off
delay(1000);            // wait for a second
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
digitalWrite(3, HIGH);
delay(999);
digitalWrite(3, LOW);
delay(999);
digitalWrite(4, HIGH);
delay(999);
digitalWrite(4, LOW);
delay(999);
digitalWrite(5, HIGH);
delay(40);
digitalWrite(5, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(6, LOW);
delay(1000);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
delay(1000);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11, LOW);
delay(1000);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(5, HIGH);
delay(40);
digitalWrite(5, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(11, HIGH);
delay(40);
digitalWrite(11, LOW);
delay(40);
digitalWrite(12, HIGH);
delay(40);
digitalWrite(12, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(6, HIGH);
delay(40);
digitalWrite(6, LOW);
delay(40);
digitalWrite(7, HIGH);
delay(40);
digitalWrite(7, LOW);
delay(40);
digitalWrite(10, HIGH);
delay(40);
digitalWrite(10, LOW);
delay(40);
digitalWrite(9, HIGH);
delay(40);
digitalWrite(9, LOW);
delay(40);
digitalWrite(3, HIGH);
delay(40);
digitalWrite(3, LOW);
delay(40);
digitalWrite(4, HIGH);
delay(40);
digitalWrite(4, LOW);
delay(40);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(2, HIGH);   // set the LED on
delay(10000);              // wait for a second
digitalWrite(2, LOW);    // set the LED off
delay(10000);}          // wait for a second

/*  Blink  Turns on an LED on for one second, then off for one second, repeatedly.   This example code is in the public domain. */
void setup() {                  // initialize the digital pin as an output.  // Pin 13 has an LED connected on most Arduino boards:  pinMode(13, OUTPUT); pinMode(12, OUTPUT);pinMode(11, OUTPUT);pinMode(10, OUTPUT);pinMode(9, OUTPUT); pinMode(8, OUTPUT);pinMode(7, OUTPUT);pinMode(6, OUTPUT);pinMode(5, OUTPUT);pinMode(4, OUTPUT);pinMode(3, OUTPUT);pinMode(2, OUTPUT);}
void loop() {  digitalWrite(2, HIGH);   // set the LED on  delay(1000);              // wait for a second  digitalWrite(2, LOW);    // set the LED off  delay(1000);            // wait for a second    digitalWrite(8, HIGH);  delay(1000);   digitalWrite(8, LOW);  delay(1000);     digitalWrite(7, HIGH);  delay(1000);   digitalWrite(7, LOW);  delay(1000);     digitalWrite(5, HIGH);  delay(1000);   digitalWrite(5, LOW);  delay(1000);     digitalWrite(4, HIGH);  delay(1000);   digitalWrite(4, LOW);  delay(1000);      digitalWrite(3, HIGH);  delay(999);   digitalWrite(3, LOW);  delay(999);     digitalWrite(4, HIGH);  delay(999);   digitalWrite(4, LOW);  delay(999);     digitalWrite(5, HIGH);  delay(40);   digitalWrite(5, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);      digitalWrite(9, HIGH);  delay(100);   digitalWrite(9, LOW);  delay(100);    digitalWrite(10, HIGH);  delay(100);   digitalWrite(10, LOW);  delay(100);    digitalWrite(7, HIGH);  delay(100);   digitalWrite(7, LOW);  delay(100);     digitalWrite(6, HIGH);  delay(100);   digitalWrite(6, LOW);  delay(100);     digitalWrite(8, HIGH);  delay(1000);   digitalWrite(8, LOW);  delay(1000);     digitalWrite(6, HIGH);  delay(1000);   digitalWrite(6, LOW);  delay(1000);    digitalWrite(9, HIGH);  delay(1000);   digitalWrite(9, LOW);  delay(1000);     digitalWrite(10, HIGH);  delay(1000);   digitalWrite(10, LOW);  delay(1000);    digitalWrite(12, HIGH);  delay(1000);   digitalWrite(12, LOW);  delay(1000);     digitalWrite(11, HIGH);  delay(1000);   digitalWrite(11, LOW);  delay(1000);      digitalWrite(13, HIGH);  delay(1000);   digitalWrite(13, LOW);  delay(1000);      digitalWrite(13, HIGH);  delay(1000);   digitalWrite(13, LOW);  delay(1000);     digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);     digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);      digitalWrite(3, HIGH);  delay(1000);   digitalWrite(3, LOW);  delay(1000);        digitalWrite(3, HIGH);  delay(1000);   digitalWrite(3, LOW);  delay(1000);     digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);     digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);    digitalWrite(8, HIGH);  delay(1000);   digitalWrite(8, LOW);  delay(1000);     digitalWrite(8, HIGH);  delay(1000);   digitalWrite(8, LOW);  delay(1000);     digitalWrite(5, HIGH);  delay(40);   digitalWrite(5, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);      digitalWrite(9, HIGH);  delay(100);   digitalWrite(9, LOW);  delay(100);    digitalWrite(10, HIGH);  delay(100);   digitalWrite(10, LOW);  delay(100);    digitalWrite(7, HIGH);  delay(100);   digitalWrite(7, LOW);  delay(100);     digitalWrite(6, HIGH);  delay(100);   digitalWrite(6, LOW);  delay(100);       digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);     digitalWrite(11, HIGH);  delay(40);   digitalWrite(11, LOW);  delay(40);     digitalWrite(12, HIGH);  delay(40);   digitalWrite(12, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);    digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);     digitalWrite(6, HIGH);  delay(40);   digitalWrite(6, LOW);  delay(40);     digitalWrite(7, HIGH);  delay(40);   digitalWrite(7, LOW);  delay(40);    digitalWrite(10, HIGH);  delay(40);   digitalWrite(10, LOW);  delay(40);     digitalWrite(9, HIGH);  delay(40);   digitalWrite(9, LOW);  delay(40);        digitalWrite(3, HIGH);  delay(40);   digitalWrite(3, LOW);  delay(40);    digitalWrite(4, HIGH);  delay(40);   digitalWrite(4, LOW);  delay(40);     digitalWrite(8, HIGH);  delay(1000);   digitalWrite(8, LOW);  delay(1000);     digitalWrite(2, HIGH);   // set the LED on  delay(10000);              // wait for a second  digitalWrite(2, LOW);    // set the LED off  delay(10000);}          // wait for a second

Michael LeBlanc

3x3x3 led cube

This is my led cube made up of 27 leds connected in a matrix and running of 12 digital out pins of the microcontroller. my code is written in bianary and the 1 means on and 0 means off

/*
Based on ledcube.c from Make: September 7, 2007 weekend podcast 
http://blog.makezine.com/archive/2007/09/make_a_pocket_led_cube_we.html

Custom animation programmed by Mark Boszko, http://stationinthemetro.com
and me woooooooooooooot*/

#include <avr/pgmspace.h>        // allows use of PROGMEM to store patterns in flash

#define CUBESIZE 3
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 3333          // time each plane is displayed in us -> 100 Hz refresh
#define TIMECONST 20          // multiplies DisplayTime to get ms – why not =100?

// LED Pattern Table in PROGMEM – last column is display time in 100ms units
// TODO this could be a lot more compact but not with binary pattern representation
prog_uchar PROGMEM PatternTable[] = {
  // blink on and off
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 1,
  // flash each LED in sequence:
  // Left->Right column, then Top->Bottom row, then Upper->Lower plane
    B100, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B010, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B001, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B000, B100, B000, B000, B000, B000, B000, B000, B000, 1,
    B000, B010, B000, B000, B000, B000, B000, B000, B000, 1,
    B000, B001, B000, B000, B000, B000, B000, B000, B000, 1,
    B000, B000, B100, B000, B000, B000, B000, B000, B000, 1,
    B000, B000, B010, B000, B000, B000, B000, B000, B000, 1,
    B000, B000, B001, B000, B000, B000, B000, B000, B000, 1,
    B000, B000, B000, B100, B000, B000, B000, B000, B000, 1,
    B000, B000, B000, B010, B000, B000, B000, B000, B000, 1,
    B000, B000, B000, B001, B000, B000, B000, B000, B000, 1,
    B000, B000, B000, B000, B100, B000, B000, B000, B000, 1,
    B000, B000, B000, B000, B010, B000, B000, B000, B000, 1,
    B000, B000, B000, B000, B001, B000, B000, B000, B000, 1,
    B000, B000, B000, B000, B000, B100, B000, B000, B000, 1,
    B000, B000, B000, B000, B000, B010, B000, B000, B000, 1,
    B000, B000, B000, B000, B000, B001, B000, B000, B000, 1,
    B000, B000, B000, B000, B000, B000, B100, B000, B000, 1,
    B000, B000, B000, B000, B000, B000, B010, B000, B000, 1,
    B000, B000, B000, B000, B000, B000, B001, B000, B000, 1,
    B000, B000, B000, B000, B000, B000, B000, B100, B000, 1,
    B000, B000, B000, B000, B000, B000, B000, B010, B000, 1,
    B000, B000, B000, B000, B000, B000, B000, B001, B000, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B100, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B010, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 10,

  // Some little cube – big cube fun 
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 10,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 10,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 2,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 2,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 2,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 2,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 2,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 2,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 1,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B110, B110, B000, B110, B110, B000, B000, B000, B000, 1,
    B100, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B110, B110, B000, B110, B110, B000, B000, B000, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 1,
    B000, B000, B000, B000, B011, B011, B000, B011, B011, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B110, B110, B000, B110, B110, B000, B000, B000, B000, 1,
    B100, B000, B000, B000, B000, B000, B000, B000, B000, 1,
    B110, B110, B000, B110, B110, B000, B000, B000, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B011, B011, B000, B011, B011, B000, B000, B000, 1,
    B000, B000, B001, B000, B000, B000, B000, B000, B000, 1,
    B000, B011, B011, B000, B011, B011, B000, B000, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B000, B000, B110, B110, B000, B110, B110, B000, 1,
    B000, B000, B000, B000, B000, B000, B100, B000, B000, 1,
    B000, B000, B000, B110, B110, B000, B110, B110, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B011, B011, B000, B011, B011, B000, B000, B000, 1,
    B000, B000, B001, B000, B000, B000, B000, B000, B000, 1,
    B000, B011, B011, B000, B011, B011, B000, B000, B000, 1,
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 1,
    B000, B000, B000, B110, B110, B000, B110, B110, B000, 1,
    B000, B000, B000, B000, B000, B000, B100, B000, B000, 1,
    B000, B000, B000, B110, B110, B000, B110, B110, B000, 1,

  // Diagonal wipe, starting in the center
    B111, B111, B111, B111, B111, B111, B111, B111, B111, 5,
    B111, B111, B111, B111, B111, B111, B111, B101, B111, 1,
    B111, B111, B111, B111, B101, B111, B111, B101, B111, 1,
    B111, B111, B111, B111, B101, B111, B111, B100, B111, 1,
    B111, B101, B111, B111, B100, B111, B111, B100, B110, 1,
    B111, B101, B111, B111, B100, B111, B111, B100, B110, 1,
    B111, B011, B111, B111, B100, B110, B111, B100, B100, 1,
    B111, B100, B110, B111, B100, B100, B111, B100, B000, 1,
    B111, B100, B100, B111, B100, B000, B111, B000, B000, 1,
    B111, B100, B000, B111, B000, B000, B011, B000, B000, 1,
    B111, B000, B000, B011, B000, B000, B001, B001, B000, 1,

  // 2-LED wide diaginal stripe that orbits the cube
    B011, B000, B000, B001, B001, B000, B000, B001, B001, 1,
    B001, B001, B000, B000, B001, B001, B000, B000, B011, 1,
    B000, B001, B001, B000, B000, B011, B000, B000, B110, 1,
    B000, B000, B011, B000, B000, B110, B000, B100, B100, 1,
    B000, B000, B110, B000, B100, B100, B100, B100, B000, 1,
    B000, B100, B100, B100, B100, B000, B110, B000, B000, 1,
    B100, B100, B000, B110, B000, B000, B011, B000, B000, 1,
    B110, B000, B000, B011, B000, B000, B001, B001, B000, 1,

  // Now, with center flashies, for flavor 
    B011, B000, B000, B001, B001, B000, B000, B011, B001, 1,
    B001, B001, B000, B000, B001, B001, B000, B000, B011, 1,
    B000, B001, B001, B000, B000, B011, B000, B010, B110, 1,
    B000, B000, B011, B000, B000, B110, B000, B100, B100, 1,
    B000, B000, B110, B000, B100, B100, B100, B110, B000, 1,
    B000, B100, B100, B100, B100, B000, B110, B000, B000, 1,
    B100, B100, B000, B110, B000, B000, B011, B010, B000, 1,
    B110, B000, B000, B011, B000, B000, B001, B001, B000, 1,
    B011, B000, B000, B001, B011, B000, B000, B001, B001, 1,
    B001, B001, B000, B000, B001, B001, B000, B000, B011, 1,
    B000, B001, B001, B000, B010, B011, B000, B000, B110, 1,
    B000, B000, B011, B000, B000, B110, B000, B100, B100, 1,
    B000, B000, B110, B000, B110, B100, B100, B100, B000, 1,
    B000, B100, B100, B100, B100, B000, B110, B000, B000, 1,
    B100, B100, B000, B110, B010, B000, B011, B000, B000, 1,
    B110, B000, B000, B011, B000, B000, B001, B001, B000, 1,
    B011, B010, B000, B001, B001, B000, B000, B001, B001, 1,
    B001, B001, B000, B000, B001, B001, B000, B000, B011, 1,
    B000, B011, B001, B000, B000, B011, B000, B000, B110, 1,
    B000, B000, B011, B000, B000, B110, B000, B100, B100, 1,
    B000, B010, B110, B000, B100, B100, B100, B100, B000, 1,
    B000, B100, B100, B100, B100, B000, B110, B000, B000, 1,
    B100, B110, B000, B110, B000, B000, B011, B000, B000, 1,
    B110, B000, B000, B011, B000, B000, B001, B001, B000, 1,

  // Wrapping up
    B001, B001, B000, B000, B001, B001, B000, B000, B001, 1,
    B001, B001, B000, B000, B001, B001, B000, B000, B001, 1,
    B000, B001, B001, B000, B000, B001, B000, B000, B001, 1,
    B000, B000, B001, B000, B000, B001, B000, B000, B001, 1,
    B000, B000, B000, B000, B000, B001, B000, B000, B001, 1,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 3,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 3,
    B000, B000, B000, B000, B000, B000, B000, B000, B001, 5,
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 3,

  // this is a dummy element for end of table (duration=0)
    B000, B000, B000, B000, B000, B000, B000, B000, B000, 0 
};

/*
** Defining pins in array makes it easier to rearrange how cube is wired
** Adjust numbers here until LEDs flash in order – L to R, T to B
** Note that analog inputs 0-5 are also digital outputs 14-19!
** Pin DigitalOut0 (serial RX) and AnalogIn5 are left open for future apps
*/

//int LEDPin[] = {16, 3, 1, 15, 4, 6, 14, 5, 7};
int LEDPin[] = {5, 6, 7, 8, 9, 10, 11, 12, 13};

//int PlanePin[] = {19, 18, 17};
int PlanePin[] = {2, 3, 4};

// initialization
void setup()
{
  int pin;      // loop counter
  // set up LED pins as output (active HIGH)
  for (pin=0; pin<PLANESIZE; pin++) {
    pinMode( LEDPin[pin], OUTPUT );
  }
  // set up plane pins as outputs (active LOW)
  for (pin=0; pin<CUBESIZE; pin++) {
    pinMode( PlanePin[pin], OUTPUT );
  }
}

// display pattern in table until DisplayTime is zero (then repeat)
void loop()
{
  // declare variables
  byte PatternBuf[ PLANESIZE ];      // saves current pattern from PatternTable
  int PatternIdx;
  byte DisplayTime;        // time*100ms to display pattern
  unsigned long EndTime;
  int plane;      // loop counter for cube refresh
  int patbufidx;   // indexes which byte from pattern buffer
  int ledrow;    // counts LEDs in refresh loop
  int ledcol;    // counts LEDs in refresh loop
  int ledpin;    // counts LEDs in refresh loop

  // Initialize PatternIdx to beginning of pattern table
  PatternIdx = 0;
  // loop over entries in pattern table – while DisplayTime>0
  do {
    // read pattern from PROGMEM and save in array
    memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
    PatternIdx += PLANESIZE;
    // read DisplayTime from PROGMEM and increment index
    DisplayTime = pgm_read_byte_near( PatternTable + PatternIdx++ );   
    // compute EndTime from current time (ms) and DisplayTime
    EndTime = millis() + ((unsigned long) DisplayTime) * TIMECONST;

    // loop while DisplayTime>0 and current time < EndTime
    while ( millis() < EndTime ) {
      patbufidx = 0;    // reset index counter to beginning of buffer
      // loop over planes
      for (plane=0; plane<CUBESIZE; plane++) {
        // turn previous plane off
        if (plane==0) {
          digitalWrite( PlanePin[CUBESIZE-1], HIGH );
        } else {
          digitalWrite( PlanePin[plane-1], HIGH );
        }

        // load current plane pattern data into ports
        ledpin = 0;
        for (ledrow=0; ledrow<CUBESIZE; ledrow++) {
          for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
            digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
          }
          patbufidx++;
        }

        // turn current plane on
        digitalWrite( PlanePin[plane], LOW );
        // delay PLANETIME us
        delayMicroseconds( PLANETIME );
      }    // for plane
    }    // while <EndTime
  } while (DisplayTime > 0);        // read patterns until time=0 which signals end
}

Darren Dawdy- Dice Roll Randomizer

This is the Dice Roll Randomizer. All you do is set the die or dice on the metal half circle connected to the motor, and it will spin and fling the dice, spinning, towards the ground.  It is safe to put the dice on the metal half circle while the one of the green lights is on, and not safe when the red lights are on, because the half circle will be spinning (It probably wouldn’t hurt you though).  The arduino is programmed to blink one green light at a time in order from farthest from red lights to closest to red lights.  The arduino then turns on the red lights to signal the user to not put dice there, waits one second for safety, and then spins the motor to fling the dice.  The arduino and the breadboard are sitting on cardboard, while the motor is mounted on a cardboard ledge to provide space for the dice to drop down.

Dice_Roller

Pins 7 through 13 are outputs. Pins 9 through 13 each control one green LED, pin 8 controls the three red LED’s, which all light simultaneously, and pin 7 controls the motor.

Seth Simon’s Crazy Light Show!

Seth’s Crazy Light Show

Hi there I didn’t really know what to make with the arduino project, so I used some creativitiy and made some cool patterns and chaser lights!

I wanted to keep things simple with loops that manipulated the lights in a chaser fashion. I also desided to make several light up at the same time.

This project displays flashy lights and is meant to enterain anyone that watches!

IMG_0696

Video of the lights! It’s awesome, but a little long! It changes towards the end too.

int timer = 250;           // The higher the number, the slower the timing.
int timertwo=300;
int ledPins[] = {
  2, 3,4,5,6, 7 };       // an array of pin numbers to which LEDs are attached
int pinCount = 6;           // the number of pins (i.e. the length of the array)
int count, counter =0;
void setup() {
  int thisPin;
  // the array elements are numbered from 0 to (pinCount – 1).
  // use a for loop to initialize each pin as an output:
  for (int thisPin = 0; thisPin < pinCount; thisPin++)  {
    pinMode(ledPins[thisPin], OUTPUT);     
  }
}

void loop() {
  if (counter <3)
    timer=timer;
   else
    timer=50;
   
    counter++;
  for (int count = 0; count<2; count ++){
  // loop from the lowest pin to the highest:
  for (int thisPin = 0; thisPin < pinCount; thisPin++) {
    // turn the pin on:
    digitalWrite(ledPins[thisPin], HIGH);  
    delay(timer);                 
    // turn the pin off:
    digitalWrite(ledPins[thisPin], LOW);   

  }

  // loop from the highest pin to the lowest:
  for (int thisPin = pinCount – 1; thisPin >= 0; thisPin–) {
    // turn the pin on:
    digitalWrite(ledPins[thisPin], HIGH);
    delay(timer);
    // turn the pin off:
    digitalWrite(ledPins[thisPin], LOW);
 
  }}
  for (int count =0; count<4; count++) {
    for (int thisPin = 0; thisPin < pinCount; thisPin= thisPin +2) {
    // turn the pin on
    digitalWrite(ledPins[thisPin], HIGH);  
    delay(timer);                 
    // turn the pin off:
    digitalWrite(ledPins[thisPin], LOW);   

  }
 
    for (int thisPin = pinCount – 1; thisPin >= 0; thisPin=thisPin -2) {
    // turn the pin on:
    digitalWrite(ledPins[thisPin], HIGH);
    delay(timer);
    // turn the pin off:
    digitalWrite(ledPins[thisPin], LOW);
    }
  }
  for(int count =0; count<3; count++){
  digitalWrite(7, HIGH);

  digitalWrite(6, HIGH);
 
  digitalWrite(5, HIGH);
  delay(200);
  digitalWrite(4, HIGH);

  digitalWrite(3, HIGH);

  digitalWrite(2, HIGH);
  delay(timer);
 
  digitalWrite(7, LOW);
  delay(timer);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(timer);
  digitalWrite(4, LOW);
  delay(timer);
  digitalWrite(3, LOW);

  digitalWrite(2, LOW);
 
  }
  for (int count=0; count<5; count++)
  {
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    delay(900);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
    delay(600);
    digitalWrite(6,HIGH);
    digitalWrite(7,HIGH);
    delay(300);
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    delay(900);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    delay(600);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    delay(300);
   
  }
   
}

John Nguyen Wayne’s bell dinger

what it does – makes the bell ring

how it works – the servo motor with a paper clip rotates and hits the bell. THen it goes back and hits it again.

Materials – a big paper clip, a small paper clip, arduino, a bell, rubber bands, and wires.

How to make it -

1. get the small paper clip.  Straighten it out and slip it into one side of the white thing on the servo motor. wrap it around the white thing until it’s secure, but leave a length of paper clip perpendicular to the white thing so you can hit the bell with it.

2. get the big paper clip. Straighten it out and wrap part of it right above the bell.  Make it tight enough so once you let go of the bell, the paper clip can hold it.  If you can’t, use solder to make the bell hold steady.  Bend the paper clip perpendicular halfway in the rest of the paper clip length.  Then at the other end make a hook out of it.

3. Attach the bell to the sirvo motor.  Grab the hook end of the paper clip and put it to the side of the servo motor.  Use rubber bands to tighten the bell so it the bell stays above the servo motor and near the small paper clip so the small paper clip can hit the bell.

4. Wire the servo motor to the arduino – get 3 wires. Attach each of them into each hole of the servo link.  Put the brown cord, the ground, into ground.  Put the red cord, the power, into the 5v hole. Then put the yellow cord, the signal, to pinhole 9.

5. Program the arduino – open the arduino software. Go to examples > servo > then sweep.  now follow the coding below:

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0;    // variable to store the servo position

void setup()
{
myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop()
{
for(pos = 0; pos < 0; pos += 1)  // goes from 0 degrees to 180 degrees
{                                  // in steps of 1 degree
myservo.write(pos);              // tell servo to go to position in variable ‘pos’
delay(15);                       // waits 15ms for the servo to reach the position
}
for(pos = 95; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
{
myservo.write(pos);              // tell servo to go to position in variable ‘pos’
delay(15);                       // waits 15ms for the servo to reach the position
}

6. click upload and hopefully it dings like crazy to annoy everyone :)