Announcements

November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!


Hypnotize Wheel

Project Members: 
Laura Greig

Description

A wheel painted with a spiral pattern to use for hypnotizing. LEDs fire randomly behind it for added madness.

Components

DC motor
Transistor
Diode
Resistors
Wheel
4x white LEDs

Arduino Code

/*
* one pot fades one motor
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
* Modified again by Laura
*/

int potPin = 0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
int led1 = 1;
int led2 = 2;
int led3 = 3;
int led4 = 4;
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
digitalWrite(led1, HIGH);
delay(random(10,100));
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
delay(random(10,100));
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
delay(random(10,100));
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
delay(random(10,100));
digitalWrite(led4, LOW);
} 

Powered by Drupal - Design by Artinet