You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/getting-started-with-modbus-rtu/content.md
+6-12
Original file line number
Diff line number
Diff line change
@@ -95,8 +95,7 @@ int counter = 0;
95
95
void setup()
96
96
{
97
97
Serial.begin(9600);
98
-
while (!Serial)
99
-
;
98
+
while (!Serial);
100
99
101
100
Serial.println("Modbus RTU Client");
102
101
@@ -105,8 +104,7 @@ void setup()
105
104
// start the Modbus RTU client
106
105
if (!ModbusRTUClient.begin(baudrate, SERIAL_8E1)) {
107
106
Serial.println("Failed to start Modbus RTU Client!");
108
-
while (1)
109
-
;
107
+
while (1);
110
108
}
111
109
}
112
110
```
@@ -161,8 +159,7 @@ int counter = 0;
161
159
void setup()
162
160
{
163
161
Serial.begin(9600);
164
-
while (!Serial)
165
-
;
162
+
while (!Serial);
166
163
167
164
Serial.println("Modbus RTU Client");
168
165
@@ -171,8 +168,7 @@ void setup()
171
168
// start the Modbus RTU client
172
169
if (!ModbusRTUClient.begin(baudrate, SERIAL_8E1)) {
173
170
Serial.println("Failed to start Modbus RTU Client!");
174
-
while (1)
175
-
;
171
+
while (1);
176
172
}
177
173
}
178
174
@@ -366,8 +362,7 @@ void setup() {
366
362
// start the Modbus RTU client
367
363
if (!ModbusRTUServer.begin(42, baudrate, SERIAL_8E1)) {
368
364
Serial.println("Failed to start Modbus RTU Client!");
369
-
while (1)
370
-
;
365
+
while (1);
371
366
}
372
367
373
368
// configure coils at address 0x00
@@ -424,8 +419,7 @@ void setup() {
424
419
// start the Modbus RTU client
425
420
if (!ModbusRTUServer.begin(42, baudrate, SERIAL_8E1)) {
426
421
Serial.println("Failed to start Modbus RTU Client!");
0 commit comments