Go Down

Topic: Guys need Help for the delay function (Read 298 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
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview