/* Photocell simple testing sketch. Connect one end of the photocell to 5V, the other end to Analog 0. Then connect one end of a 10K resistor from Analog 0 to ground Connect LED from pin 11 through a resistor to ground For more information see www.ladyada.net/learn/sensors/cds.html */ int photocellPin = 0; // the cell and 10K pulldown are connected to a0 int photocellReading; // the analog reading from the sensor divider int LEDpin = 11; // connect Red LED to pin 11 (PWM pin) int LEDbrightness; // #include // Connect a stepper motor with 48 steps per revolution (7.5 degree) // to motor port #2 (M3 and M4) AF_Stepper motor(48, 2); void setup(void) { // We'll send debugging information via the Serial monitor Serial.begin(9600); Serial.println("Stepper test!"); motor.setSpeed(10); // 10 rpm } void loop(void) { photocellReading = analogRead(photocellPin); Serial.print("Analog reading = "); Serial.println(photocellReading); // the raw analog reading if (photocellReading > 900) { Serial.println("Single coil steps"); motor.step(8, FORWARD, SINGLE); //delay(5000); motor.release(); } delay(150); }