Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. void mostra_endereco_sensor(DeviceAddress deviceAddress)
  2. {
  3. for (uint8_t i = 0; i < 8; i++)
  4. {
  5. // Adiciona zeros se necessário
  6. if (deviceAddress[i] < 16) Serial.print("0");
  7. Serial.print(deviceAddress[i], HEX);
  8. }
  9. }
  10.  
  11. void loop()
  12. {
  13. // Le a informacao do sensor
  14. sensors.requestTemperatures();
  15. float tempC = sensors.getTempC(sensor1);
  16. // Atualiza temperaturas minima e maxima
  17. // if (tempC < tempMin)
  18. // {
  19. // tempMin = tempC;
  20. // }
  21. // if (tempC > tempMax)
  22. // {
  23. // tempMax = tempC;
  24. // }
  25. // Mostra dados no serial monitor
  26. Serial.print("Temp C: ");
  27. Serial.print(tempC);
  28. // Serial.print(" Min : ");
  29. // Serial.print(tempMin);
  30. // Serial.print(" Max : ");
  31. // Serial.println(tempMax);
  32. //
  33. // Mostra dados no LCD
  34. // lcd.clear();
  35. // lcd.setCursor(0,0);
  36. // lcd.print("Temp.: ");
  37. // //Simbolo grau
  38. // lcd.write(223);
  39. // lcd.print("C");
  40. // lcd.setCursor(7,0);
  41. // lcd.print(tempC);
  42. // lcd.setCursor(0,1);
  43. // lcd.print("L: ");
  44. // lcd.setCursor(3,1);
  45. // lcd.print(tempMin,1);
  46. // lcd.setCursor(8,1);
  47. // lcd.print("H: ");
  48. // lcd.setCursor(11,1);
  49. // lcd.print(tempMax,1);
  50. delay(3000);
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement