How to stop loop
i have a dfrobot arduino , want motors to run within amount of time put in loop loop never stops. how can make stop?
int e1 = 5; //m1 speed control
int e2 = 6; //m2 speed control
int m1 = 4; //m1 direction control
int m2 = 7; //m1 direction control
void setup(){
int i;
for(i=0;i<=9;i++)
{
analogwrite (e1,100); //pwm speed control
digitalwrite(m1,high);
analogwrite (e2,100);
digitalwrite(m2,high);
}
}
void loop(){
}
int e1 = 5; //m1 speed control
int e2 = 6; //m2 speed control
int m1 = 4; //m1 direction control
int m2 = 7; //m1 direction control
void setup(){
int i;
for(i=0;i<=9;i++)
{
analogwrite (e1,100); //pwm speed control
digitalwrite(m1,high);
analogwrite (e2,100);
digitalwrite(m2,high);
}
}
void loop(){
}
read how blinky without delays work, use time of desired duration , stops being executed.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > How to stop loop
arduino
Comments
Post a Comment