Control the speed http://www.dummies.com/how-to/content/how-to-control-the-speed-of-a-dc-motor-with-the-ar.html
The text in which is needed for the design of my project number 2.
night light setup
void setup() {
Serial.begin(9600);
pinMode(3, OUTPUT);
}
void loop() {
int sensorValue = analogRead(A0);
if (sensorValue < 200) { // To change the point at which the light turns on change this value.
digitalWrite(3, HIGH);
}
else {
digitalWrite(3,LOW);
}
}
http://makezine.com/projects/arduino-controlled-night-light/ website for coding
^^ This is the sensor light in which the LEDs go on when the sensor is covered.
const int switchPin = 2;
const int motorPin = 9;
int switchState = 0;
void setup() {
pinMode(motorPin, OUTPUT);
pinMode(switchPin, INPUT);
}
void loop(){
switchState = digitalRead(switchPin);
if (switchState == HIGH) {
digitalWrite(motorPin, HIGH);
}
else {
digitalWrite(motorPin, LOW);
}
}
coding for the process in which the wheel spins.
Must still figure out how to control the speed in which the wheel spins.
the other idea is to go with the LCD screen saying open or closed depending on the operation of the wheel itself.