Hi, My name is Kenneth it is my first time posting seeking for help
my apologies if anything I type below is unclear
Today i was doing programming with the Arduino Mega using QRD1114. i got the analog reading
i type in the code like this
void loop
{
while(frontsensor<=0&&frontSensor>=400)
{
MotorRun();
}
}
*MotorRun is just a function for the H-bridge to enable both wheel to go forward
Assuming that both variables are actually frontsensor, this while loop will never execute. The value of the variable can't be both <= 0 AND >=400. As electricteardown suggested, it would make more sense if you meant OR in this case.
Can you post your complete program. Use code tags (the "#" button above the row of smileys). Copy and paste it from the Arduino IDE to avoid transcription errors.