Closed
Description
This code
do
{
delay(50); // wait for sensors to stabilize
x = readSensors(); // check the sensors
} while (x < 100);
will never work? The variable is declared inside the loop and thus not even accessable from the while? See http://tpcg.io/50Rx6f to compile this online.
$gcc -o main *.c
main.c: In function ‘main’:
main.c:8:14: error: ‘x’ undeclared (first use in this function)
} while (x < 100);
^
main.c:8:14: note: each undeclared identifier is reported only once for each function it appears in
Metadata
Metadata
Assignees
Labels
No labels