I wasn't sure if this belonged in software or electronics but..
I don't have my servos setup yet, so I thought I would test my sensors by turning the LED on and off depending on which sensor had a higher value. I can't get the LED to do anything though, regardless of what I do with the sensors.. am I missing something here?
The connection to the microcontroller appears to be good, this is the $50 robot build just with an atmega328p
Heres the code I'm using, pretty simple.. thanks for any help!
//detects more light on left side of robot
if(sensor_left > sensor_right && (sensor_left - sensor_right) > threshold)
{//go left
servo_left(44);
servo_right(44);
LED_on();
}
//detects more light on right side of robot
else if(sensor_right > sensor_left && (sensor_right - sensor_left) > threshold)
{//go right
servo_left(25);
servo_right(25);
LED_off();
}