help with break!
hello. im trying make make blinking light stop when push spdt microswitch. figured using break function way cant seem work.
anyone know why doesnt work!?! thanks
code: [select]
int highsignal = 9;
int endstop = 10;
int motorstep = 8;
int stopp;
void setup()
{
pinmode(highsignal, output);
pinmode(endstop, input);
pinmode(motorstep, output);
serial.begin(9600);
}
void loop()
{
analogwrite(highsignal, 255);
delay(10);
int i;
for(i = 5; < 255; i++)
{
digitalwrite(motorstep, high);
delay(100);
digitalwrite(motorstep, low);
delay(100);
stopp = analogread(endstop);
if (stopp > 200)
{
i=0;
break;
}
serial.println(i);
delay(500);
}
}
anyone know why doesnt work!?! thanks
how "not work"?
your definition of "work" may not else's.
if break out of loop, exit "loop()", end re-enter loop.
your definition of "work" may not else's.
if break out of loop, exit "loop()", end re-enter loop.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > help with break!
arduino
Comments
Post a Comment