Skip to content

Commit 7500e84

Browse files
Merge pull request #286 from arduino/benjamindannegard/opta-getting-started-fix
[PC-1074] Arduino Opta: Getting started tutorial feedback & fixes
2 parents 6c73600 + 8a92ed0 commit 7500e84

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/getting-started/content.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Getting Started With the Arduino Opta®'
2+
title: 'Getting Started With the Arduino Opta'
33
description: 'Get started with the Opta™ and get to know some of its features.'
44
difficulty: beginner
55
tags:
@@ -20,7 +20,7 @@ hardware:
2020

2121
Opta™ is a robust micro PLC solution with many engaging features. In this tutorial we will go through the setup of Opta™ with the Arduino IDE and explain how to use its basic features, showing through examples how to program the LEDs on the device, how to use the programmable button, as well as controlling its inputs and outputs.
2222

23-
![The Arduino Opta®](assets/opta-device.png)
23+
![The Arduino Opta](assets/opta-device.png)
2424

2525
## Goals
2626

@@ -32,10 +32,10 @@ Opta™ is a robust micro PLC solution with many engaging features. In this tuto
3232

3333
### Required Hardware and Software
3434

35-
- USB-C® cable
36-
- [Arduino Opta®](https://store.arduino.cc/pages/opta)
35+
- USB-C® cable (x1)
36+
- [Arduino Opta](https://store.arduino.cc/pages/opta)
3737
- [Arduino IDE](https://www.arduino.cc/en/software)
38-
- Power supply of 12-24V DC, 1A (optional if not running the section related to the relays)
38+
- Power supply of 12-24V DC, 1A (optional if not running the section related to the relays) (x1)
3939
- Analog inputs (optional, alternatively the section related to analog inputs will work but reading random values)
4040

4141
## Instructions
@@ -54,7 +54,7 @@ Now you are ready to upload sketches to the Opta™ via the Arduino IDE.
5454
Once the IDE and the core are installed, let's warm up by uploading a first sketch to your Opta™. We will be using a modified version of the classical Arduino blink sketch to put your device to work and test if everything is set properly.
5555
Let's create a simple blink sketch that will blink the four STATUS LEDs on the Opta™, highlighted in the image below.
5656

57-
![The blinking LEDs on the Opta™](assets/opta-device-LED.png)
57+
![The blinking STATUS LEDs on the Opta™](assets/opta-device-LED.png)
5858

5959
All the STATUS LEDs on the device are defined in the core of the PLC.
6060
Hereafter you can see the correspondence between each of them as identified in the core and their labeling on the front panel of the product:
@@ -64,7 +64,7 @@ Hereafter you can see the correspondence between each of them as identified in t
6464
- `LED_D2`: STATUS 3
6565
- `LED_D3`: STATUS 4
6666
- `LED_RESET`: LED above the reset button
67-
- `LED_USER`: LED above the user button (only available on the Arduino Opta WiFi, SKU: AFX00002)
67+
- `LED_USER`: LED above the user button (only available on the variant with Wi-Fi® and Bluetooth® Low Energy)
6868

6969
Select the correct **board** and **port** in the **Tools** section.
7070
Copy the sketch below into the Arduino IDE sketch editor, then upload it to Opta™.
@@ -105,9 +105,9 @@ void loop() {
105105

106106
Opta™ has a programmable button, shown on the image below and identified as USER. It can be programmed using the Arduino IDE to fit your needs. To show how much simple is to use it, let's create a sketch and program the button as a trigger to modify the status of the STATUS LEDs.
107107

108-
![The button and LEDs that will light up on the Opta™](assets/opta-device-button.png)
108+
![The button and STATUS LEDs that will light up on the Opta™](assets/opta-device-button.png)
109109

110-
The button is defined in the core as `BTN_USER`: 'HIGH' as default (not pressed), and 'LOW' when pressed. The new sketch will turn on one by one the LEDs when the button is pressed, and then start over when all the lights have been turned on. Below you can find the entire sketch, where a simple [Switch (case) Statement](https://www.arduino.cc/reference/en/language/structure/control-structure/switchcase/) is used, and an image highlighting where the USER button is located on the device.
110+
The button is defined in the core as `BTN_USER`: 'HIGH' as default (not pressed), and 'LOW' when pressed. The new sketch will turn the STATUS LEDs on one by one when the button is pressed, and then start over when all the lights have been turned on. Below you can find the entire sketch, where a simple [Switch (case) Statement](https://www.arduino.cc/reference/en/language/structure/control-structure/switchcase/) is used, and an image highlighting where the USER button is located on the device.
111111

112112
```arduino
113113
int buttonState = 0;
@@ -164,13 +164,13 @@ void changeLights() {
164164

165165
Once the sketch is uploaded, you can see that an additional LED is turned on each time you press the button, following the sequence:
166166

167-
| Interaction | Result |
168-
| ------------ | ---------------------- |
169-
| First press | LED 1 ON. |
170-
| Second press | LEDs 1 and 2 ON. |
171-
| Third press | LEDS 1, 2 and 3 ON. |
172-
| Fourth press | LEDS 1, 2, 3 and 4 ON. |
173-
| Fifth press | All leds off and back. |
167+
| Interaction | Result |
168+
| ------------ | ----------------------------- |
169+
| First press | STATUS LED 1 ON. |
170+
| Second press | STATUS LEDs 1 and 2 ON. |
171+
| Third press | STATUS LEDs 1, 2 and 3 ON. |
172+
| Fourth press | STATUS LEDs 1, 2, 3 and 4 ON. |
173+
| Fifth press | All STATUS LEDs off and back. |
174174

175175

176176
### Using Out Relays
@@ -196,7 +196,7 @@ The “clean” contact also allows carrying a different power system or type of
196196

197197
![Clean contact on the Opta™](assets/opta-clean-contact.png)
198198

199-
Let's run a simple sketch to test the output relays on Opta™: in this sketch all the 4 relays are closing and reopening their contacts and after each relay's cycle a led, will be turned on to provide a visual feedback.
199+
Let's run a simple sketch to test the output relays on Opta™: in this sketch all the 4 relays are closing and reopening their contacts and after each relay's cycle a led will be turned on to provide visual feedback.
200200
To activate the relays and run this sketch you need to provide Opta™ with a voltage from 12 to 24 V DC by connecting it a proper power supply.
201201

202202
Opta™ has dedicated terminals for power supply located in the upper part of Opta™ and next to the inputs. They are duplicated to help the user to connect the power supply and any common part to the input terminals but they have the same potential (upon polarity).
@@ -329,7 +329,7 @@ void loop() {
329329
}
330330
```
331331

332-
Once you have uploaded the code, open the serial monitor to see the values read in each analog input. Ig you have connected a device with an analog voltage value in I1, I2, and/or I3 you will see the voltage or analog value of each of the signals. In case you did not connect anything to the analog inputs, you will see how the values oscillate between 0V and a very small value because the pins are floating.
332+
Once you have uploaded the code, open the serial monitor to see the values read in each analog input. If you have connected a device with an analog voltage value in I1, I2, and/or I3 you will see the voltage or analog value of each of the signals. In case you did not connect anything to the analog inputs, you will see how the values oscillate between 0V and a very small value because the pins are floating.
333333

334334
You may notice from the output values that when the maximum value of 10V is reached, the corresponding numerical value is not 4095 as the maximum value with 12 bits resolution should be. The reason is that there is a precautional margin taken on the maximum voltage level applicable to the inputs to preserve the integrity of the microcontroller.
335335

0 commit comments

Comments
 (0)