Pages: [1]   Go Down
Author Topic: Guys need Help for the delay function  (Read 246 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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


 smiley-cry smiley-cry smiley-cry smiley-cry
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46107
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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....
Logged

Pages: [1]   Go Up
Jump to: