help with break!


hello. im trying make make blinking light stop when push spdt microswitch. figured using break function way cant seem work.
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.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > help with break!


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums