Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <DallasTemperature.h>
  2. #define teplomer_pin D4 // = GPIO15
  3. #define svetlo_Pin D6 // = GPIO00
  4.  
  5. float temp_w; // teplota vody
  6.  
  7. OneWire oneWire(teplomer_pin);
  8.  
  9. DallasTemperature sensors(&oneWire);
  10. DeviceAddress vodacidlo = {0x28, 0xFF, 0xCE, 0x57, 0x70, 0x16, 0x04, 0x5E};
  11.  
  12. void setup() {
  13. Serial.begin(115200);
  14. sensors.begin();
  15. sensors.setResolution(10); // rozlišení teploměrů
  16. }
  17. void loop() {
  18.  
  19.  
  20. sensors.requestTemperatures();
  21. temp_w = sensors.getTempC(vodacidlo); //teplota vody
  22.  
  23. analogWrite(svetlo_Pin, 20);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement