Should I use the blink without delay?


hello all,

i have created code:

code: [select]
const int m1r=2;
const int m1l=3;
const int m2f=9;
const int m2b=11;
const int threshold = 400;
const int sensormin = 100;

void setup(){
  pinmode(m1r, output);
   pinmode(m1l, output);
    pinmode(m2f, output);
     pinmode(m2b, output);
}
void loop(){
 int analogvalue = analogread(0);
   
if (analogvalue > threshold) {
 
 
    digitalwrite(m2b,low);
 digitalwrite(m2f,high);
 
  delay(1000);
 
  digitalwrite(m2b,low);
  digitalwrite(m2f,low);
 
  digitalwrite(m1r,high);
  digitalwrite(m1l,high);
 
 
 
 }
 

else{
 
 digitalwrite(m2f,low);
 digitalwrite(m2b,high);
digitalwrite(m1r,high);
  digitalwrite(m1l,high);
}

}


if upload code when if statement used , arduino code before delay. why?

while @ it, can put default value pins.(example pin m2f==high unless changed)

thanks

quote
the arduino code before delay


how can tell?  have tried putting[font=courier] serial.println("whatever"); [/font]immediately after delay?


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Should I use the blink without delay?


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