Add "grande chambre" (using esp8266 nodemcu)
[manu/arduino-maison.git] / getonewireaddrs / getonewireaddr / getonewireaddr.ino
1 /*
2  * Rui Santos 
3  * Complete Project Details https://randomnerdtutorials.com
4  */
5
6 #include <OneWire.h>
7
8 // Based on the OneWire library example
9
10 OneWire ds(19);  //data wire connected to GPIO 4
11
12 void setup(void) {
13   Serial.begin(115200);
14 }
15
16 void loop(void) {
17   byte i;
18   byte addr[8];
19   
20   if (!ds.search(addr)) {
21     Serial.println(" No more addresses.");
22     Serial.println();
23     ds.reset_search();
24     delay(250);
25     return;
26   }
27   Serial.print(" ROM =");
28   for (i = 0; i < 8; i++) {
29     Serial.write(' ');
30     Serial.print(addr[i], HEX);
31   }
32 }