Description
A small, unassuming box holding a hypnotic spiral and a disorienting flashing light. Users are invited to peek in for visual stimulatory purposes.
Materials
1 DC motor
1 Potentiometer
1 Blue LED
1 Transistor
1 Battery Pack
Styrofoam
Transparency Print
Cardboard
Arduino Code
/*
* one pot fades one motor
* + blink LED light
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
*/
int bluePin = 10;
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
void setup() {
Serial.begin(9600);
pinMode(10, OUTPUT);
}
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(10, HIGH); // set LED on
delay(30); // wait for .2 second
digitalWrite(10, LOW); // set LED off
delay(100); // wait for .2 second
}