lar3ry:
easterly81:
I want to display temperature from various sensors while running other code.If i do somthing like blink without delay it will constantly display for 1 minute them wait a minute.
How do i make the serial print happen only once each minute?
What the others are telling you is that the example needs to be understood, not that it needs to be blindly copied.
Lets look at what you need to do, using the principles found in Blink Without Delaydeclare an unsigned long variable called start_time
declare an unsigned long variable called duration
setup
set up pins,
set up Serial
Save current millis() in start_time
end of setup
loop
if the current millis() - start_time is >= duration
do something (this could include reading temperature and printing it)
Save current millis() in start_time (starts the timing all over again)
end of the if
do any other stuff you want to do
end of the loop (goes back to loop)
thanks for the not so smart %#s reply
the = is what i believe is was missing right before the interval