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/content.md
+26-27Lines changed: 26 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -207,53 +207,52 @@ The entire sketch can be found below, copy it into your IDE and upload it to you
207
207
208
208
```arduino
209
209
void setup() {
210
-
// initialize Relays outputs.
211
-
pinMode(D0, OUTPUT); // sets the rele pin D0 as output
212
-
pinMode(D1, OUTPUT); // sets the rele pin D1 as output
213
-
pinMode(D2, OUTPUT); // sets the rele pin D2 as output
214
-
pinMode(D3, OUTPUT); // sets the rele pin D3 as output
210
+
// Initialize Relays outputs
211
+
pinMode(D0, OUTPUT);
212
+
pinMode(D1, OUTPUT);
213
+
pinMode(D2, OUTPUT);
214
+
pinMode(D3, OUTPUT);
215
215
216
-
// initialize digital pin LED_BUILTIN as an output.
216
+
// Initialize OPTA LEDs
217
217
pinMode(LED_D0, OUTPUT);
218
218
pinMode(LED_D1, OUTPUT);
219
219
pinMode(LED_D2, OUTPUT);
220
220
pinMode(LED_D3, OUTPUT);
221
221
}
222
222
223
223
void loop() {
224
-
// closes and opens the contcat of the relay 1 and turns on led 1.
225
-
digitalWrite(D0, HIGH); // sets the Rele 1 on
224
+
// Closes and opens the contact of relay 1 and turns on led 1
225
+
digitalWrite(D0, HIGH); // Sets the relay 1 on
226
226
digitalWrite(LED_D0, HIGH);
227
-
delay(1000); // waits for a second
228
-
digitalWrite(D0, LOW); // sets the Rele 1 off
227
+
delay(1000);
228
+
digitalWrite(D0, LOW); // Sets the relay 1 off
229
229
digitalWrite(LED_D0, LOW);
230
-
delay(1000); // waits for a second
230
+
delay(1000);
231
231
232
-
// closes and opens the contcat of the relay 2 and turns on led 2
233
-
digitalWrite(D1, HIGH); // sets the Rele 1 on
232
+
// Closes and opens the contact of relay 2 and turns on led 2
233
+
digitalWrite(D1, HIGH); // Sets the relay 2 on
234
234
digitalWrite(LED_D1, HIGH);
235
-
delay(1000); // waits for a second
236
-
digitalWrite(D1, LOW); // sets the Rele 1 off
235
+
delay(1000);
236
+
digitalWrite(D1, LOW); // Sets the relay 2 off
237
237
digitalWrite(LED_D1, LOW);
238
-
delay(1000); // waits for a second
238
+
delay(1000);
239
239
240
-
// closes and opens the contcat of the relay 3 and turns on led 3
241
-
digitalWrite(D2, HIGH); // sets the Rele 1 on
240
+
// Closes and opens the contact of relay 3 and turns on led 3
241
+
digitalWrite(D2, HIGH); // Sets the relay 3 on
242
242
digitalWrite(LED_D2, HIGH);
243
-
delay(1000); // waits for a second
244
-
digitalWrite(D2, LOW); // sets the Rele 1 off
243
+
delay(1000);
244
+
digitalWrite(D2, LOW); // Sets the relay 3 off
245
245
digitalWrite(LED_D2, LOW);
246
-
delay(1000); // waits for a second
246
+
delay(1000);
247
247
248
-
// closes and opens the contcat of the relay 4 and turns on led 4
249
-
digitalWrite(D3, HIGH); // sets the Rele 1 on
248
+
// Closes and opens the contact of relay 4 and turns on led 4
249
+
digitalWrite(D3, HIGH); // Sets the relay 4 on
250
250
digitalWrite(LED_D3, HIGH);
251
-
delay(1000); // waits for a second
252
-
digitalWrite(D3, LOW); // sets the Rele 1 off
251
+
delay(1000);
252
+
digitalWrite(D3, LOW); // Sets the relay 4 off
253
253
digitalWrite(LED_D3, LOW);
254
-
delay(1000); // waits for a second
254
+
delay(1000);
255
255
}
256
-
```
257
256
258
257
*** Important: It is not possible to program the Opta while it is being powered with the power pins. You would need to disconnect the power supply, upload the program and then connect the power again. ***
0 commit comments