Go Down

Topic: temperature.. please answer (Read 220 times) previous topic - next topic


what code can i use to check the temperature every 5 sec with lm35 ?


Code: [Select]

const unsigned long interval = 5000;           // Interval between samples, in milliseconds

void setup() {   

void loop() {
    static unsigned long previousMillis = 0;
    unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval)  {
     previousMillis = currentMillis;
     // The code in this block is executed every 'interval' milliseconds

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Great  that is "temperature reading without delay()"  :)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131