Skip to content

Commit 51af4a5

Browse files
committed
Formatting
1 parent 0873c49 commit 51af4a5

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/mqtt_esp_1.ino

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ String macToStr(const uint8_t* mac)
4040
void setup() {
4141
Serial.begin(115200);
4242
delay(10);
43-
43+
4444
Serial.println();
4545
Serial.println();
4646
Serial.print("Connecting to ");
4747
Serial.println(ssid);
48-
48+
4949
WiFi.begin(ssid, password);
50-
50+
5151
while (WiFi.status() != WL_CONNECTED) {
5252
delay(500);
5353
Serial.print(".");
5454
}
5555
Serial.println("");
56-
Serial.println("WiFi connected");
56+
Serial.println("WiFi connected");
5757
Serial.println("IP address: ");
5858
Serial.println(WiFi.localIP());
5959

@@ -70,7 +70,7 @@ void setup() {
7070
Serial.print(server);
7171
Serial.print(" as ");
7272
Serial.println(clientName);
73-
73+
7474
if (client.connect((char*) clientName.c_str())) {
7575
Serial.println("Connected to MQTT broker");
7676
}
@@ -87,12 +87,12 @@ void loop() {
8787
byte type_s;
8888
byte data[12];
8989
byte addr[8];
90-
90+
9191

9292
//Loop through all DS1820
9393

9494
while(ds.search(addr))
95-
{
95+
{
9696
Serial.print("ROM =");
9797

9898
//Topic is built from a static String plus the ID of the DS18B20
@@ -108,7 +108,7 @@ while(ds.search(addr))
108108
return;
109109
}
110110
Serial.println();
111-
111+
112112
// the first ROM byte indicates which chip
113113
switch (addr[0]) {
114114
case 0x10:
@@ -126,17 +126,17 @@ while(ds.search(addr))
126126
default:
127127
Serial.println("Device is not a DS18x20 family device.");
128128
return;
129-
}
129+
}
130130

131131
ds.reset();
132132
ds.select(addr);
133133
ds.write(0x44, 1); // start conversion, with parasite power on at the end
134-
134+
135135
delay(1000); // maybe 750ms is enough, maybe not
136136
// we might do a ds.depower() here, but the reset will take care of it.
137-
137+
138138
present = ds.reset();
139-
ds.select(addr);
139+
ds.select(addr);
140140
ds.write(0xBE); // Read Scratchpad
141141

142142
Serial.print(" Data = ");
@@ -190,5 +190,3 @@ Serial.println("End of Onewire Bus");
190190
ds.reset_search();
191191
return;
192192
}
193-
194-

0 commit comments

Comments
 (0)