Go Down

Topic: Guys need Help for the delay function (Read 307 times) previous topic - next topic

misoke


My problem is, I wanna have a continuous reading for my sensor then after lets say 10 secs a message will appear....





void setup()
{
 
 Serial.begin(9600);
   
}




void loop()
{
 Serial.println("readings");                //this should be continuous
 delay(100);
 
 
 Serial.println("message");               //every 10 seconds there should appear a message or something...
 delay(10000);                              


}



the problem is the readings just print a single value not continuous


need help badly


=( =( =( =(

ambuj

may be your input pin is floating.. so int your internal pull-up resistors 

PaulS

Quote
My problem is, I wanna have a continuous reading for my sensor then after lets say 10 secs a message will appear....

Well, then get rid of the delays!. They are why you are not getting continuous readings. Look at the blink without delay example.

misoke


Well, then get rid of the delays!. They are why you are not getting continuous readings. Look at the blink without delay example.
[/quote]


I'll try that one....

Go Up