im controlling a Stepper with a photoResistor set, But if the values run to high it doesnt run the code like there is no difference between the sensors,,,, See if any on can see where my codeing is creatign the failer,, any suggestions would be greatly appreciated
/*
Thomas Wood
PhotoCell Controlled Stepper Motor Left and Right
Feb 15,2012
*/
#include <Stepper.h>
const int stepsPerRevolution = 200;Â // Turns of the motor
int inputPhotoLeft = 0; // photresistors pin
int inputPhotoRight = 1; // photresistors pin
int Left = 0; // Store readings from the photoresistors.
int Right = 0; // Store readings from the photoresistors.
int threshhold = 450;
// this is here from reading the serial monitors valued to get a ruff Idea of value to set A
           //And how dark you Want your motor to stop moving at
int difSence = 20; // differenace tolarance between sensors
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);
void setup() {
Â
 myStepper.setSpeed(150);
 Serial.begin(9600);
Â
 pinMode(13, OUTPUT); //led doesnt need to be on
}
void loop() {
Left = analogRead(inputPhotoLeft); // sets the photcells position left - right
Right = analogRead(inputPhotoRight);
//Lines for debugging ,analog display of sensor values
Serial.print(" Left \t");
Serial.print(Left);
Serial.print("Â Right \t");
Serial.println(Right);
delay(1000);
(13 == LOW);
if ((Left > threshhold) > (Right + difSence > threshhold ))
{
 Serial.print("clockwise \t");
 Serial.println(Left);
  myStepper.step(-stepsPerRevolution);
Â
 }
if ((Right > threshhold) > (Left + difSence > threshhold ))
{
Â
 Serial.print("counterclockwise \t");
 Serial.println(Right);
 myStepper.step(stepsPerRevolution);
Â
Â
}
if ((Left < threshhold) && (Right < threshhold))
{
 // this is to limit the after dark operation -
 //no need in a plane,train,street light or automobil to make the panel move :)
 Serial.println("Lower threshhold Reached - hopefully we have stopped");
 Serial.print("Left Sensor \t");
 Serial.print(Left);
 Serial.print(" Right Sensor \t");
 Serial.println(Right);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
delay(5000);
}
{
// these are here to disengage the coils as not to hold ,and in turn over heat the motor
digitalWrite(8,LOW);
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
}
}