Skip to content

Commit cd28546

Browse files
authored
Merge branch 'main' into jhansson-ard/pro-tutorial-QA
2 parents 653d70b + 9fa4d4e commit cd28546

File tree

41 files changed

+1193
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1193
-109
lines changed

content/built-in-examples/09.usb/KeyboardAndMouseControl/KeyboardAndMouseControl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tags:
1212

1313
This example illustrates the use of the Mouse and Keyboard libraries together. Five momentary switches act as directional buttons for your cursor. When a button is pressed, the cursor on your screen will move, and a keypress, corresponding to the letter associated with the direction, will be sent to the computer. Once you have the Leonardo, Micro or Due programmed and wired up, open up your favorite text editor to see the results.
1414

15-
**NB: When you use the Mouse and Keyboard library functions, the Arduino takes over your computer's cursor! To insure you don't lose control of your computer while running a sketch with this function, make sure to set up a controller before you call Mouse.move().**
15+
**NB: When you use the Mouse and Keyboard library functions, the Arduino takes over your computer's cursor! To ensure you don't lose control of your computer while running a sketch with this function, make sure to set up a controller before you call Mouse.move().**
1616

1717
### Hardware Required
1818

@@ -57,4 +57,4 @@ You can find more basic tutorials in the [built-in examples](/built-in-examples)
5757

5858
You can also explore the [language reference](https://www.arduino.cc/reference/en/), a detailed collection of the Arduino programming language.
5959

60-
*Last revision 2015/07/29 by SM*
60+
*Last revision 2015/07/29 by SM*

content/cloud/iot-cloud/tutorials/03.cloud-scheduler/cloud-scheduler.md

Lines changed: 58 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ software:
77
- iot-cloud
88
---
99

10-
It is now possible to schedule jobs with the [Arduino IoT Cloud](https://create.arduino.cc/iot/), using the new `CloudSchedule` variable type. You can pick a start & end date for when the variable should be triggered, and for how long it should be active. This is done through the IoT Cloud dashboards.
10+
It is now possible to schedule jobs with the [Arduino IoT Cloud](https://create.arduino.cc/iot/), using the new `CloudSchedule` variable type. You can pick a start & end date for when the variable should be triggered, and for how long it should be active. This variable can be controlled in real time using a graphical widget that you can place on an IoT Cloud dashboard.
1111

1212
We can for example have:
1313

14-
- One trigger scheduled to go off every minute, and last for 10 seconds
15-
- One trigger scheduled to go off every hour, and last for 10 minutes.
14+
- One trigger scheduled to run every minute for 10 seconds
15+
- One trigger scheduled to run every hour for 10 minutes
1616

1717
## Goals
1818

@@ -21,48 +21,18 @@ The goals of this project are:
2121
- Learn how the `CloudSchedule` variable works.
2222
- Learn how to access local time in your sketch.
2323

24-
## Hardware & Software Needed
25-
26-
For this tutorial, you will need a cloud compatible board. You can see the full list below:
27-
28-
- [MKR 1000 WiFi](https://store.arduino.cc/arduino-mkr1000-wifi)
29-
- [MKR WiFi 1010](https://store.arduino.cc/arduino-mkr-wifi-1010)
30-
- [MKR GSM 1400](https://store.arduino.cc/arduino-mkr-gsm-1400)\*
31-
- [MKR NB 1500](https://store.arduino.cc/arduino-mkr-nb-1500-1413)\*
32-
- [Nano RP2040 Connect](https://store.arduino.cc/nano-rp2040-connect)
33-
- [Nano 33 IoT](https://store.arduino.cc/arduino-nano-33-iot)
34-
- [Portenta H7](https://store.arduino.cc/portenta-h7)
35-
36-
***The MKR GSM 1400 & MKR NB 1500 requires a SIM card with a data plan to work. You can read more about it in [this page](https://store.arduino.cc/digital/sim).***
24+
Make sure you have a [cloud-compatible board](/cloud/iot-cloud/tutorials/technical-reference#compatible-hardware).
3725

3826
## How Does it Work?
3927

40-
The working principle of the scheduler is pretty straight forward. The `CloudSchedule` variable can be configured to go off at a specific time, with a specific duration. In the code, you do not need to worry about any timers, as this is done in the Arduino IoT Cloud. The "jobs" are created in the dashboard, through a widget associated to the variable.
28+
A variable of `CloudSchedule` type can be configured to trigger at a specific time, with a specific duration. In the code, you do not need to worry about the logic for this. The configuration of the variable is done in the dashboard, through a widget associated to the variable.
4129

42-
For example, we can set `schedule_variable` to be:
30+
For example, we can set such variable to be:
4331
- ON for 10 seconds, every minute.
4432
- ON for 8 hours, every day.
4533
- ON for a week, and then finish.
4634

47-
![Example of how a scheduler works.](assets/cloud-scheduler-img-01.png)
48-
49-
## API
50-
51-
The two **variables types** introduced in this tutorial are `CloudTime` and `CloudSchedule`. These are used to retrieve local time and to schedule a job respectively.
52-
53-
The `CloudSchedule` variable is of a **complex type**. It has a **internal boolean state**, which can be checked through the `isActive()` function (returns `true` or `false`).
54-
55-
```arduino
56-
if(schedule_variable.isActive()) {
57-
//do something
58-
}
59-
```
60-
61-
The `CloudTime` variable is an unsigned integer which is used to store current time. We can use the `getLocalTime()` function to retrieve local time.
62-
63-
```arduino
64-
time_variable = ArduinoCloud.getLocalTime();
65-
```
35+
![Example of a schedule configured to run for 10 seconds every minute.](assets/cloud-scheduler-img-01.png)
6636

6737
## Application Examples
6838

@@ -75,15 +45,12 @@ There are countless examples where schedulers can be used, but predominantly it
7545
To test out functionality of your scheduler job, we can turn on an LED while the job is active.
7646

7747
```arduino
78-
// whenever the job is "active", turn on the LED
79-
if(schedule_variable.isActive()){
80-
digitalWrite(LED, HIGH);
81-
}
82-
83-
84-
// whenever the job is "not active", turn off the LED
85-
else{
86-
digitalWrite(LED, LOW);
48+
if (schedule_variable.isActive()) {
49+
// whenever the job is "active", turn on the LED
50+
digitalWrite(LED, HIGH);
51+
} else {
52+
// whenever the job is "not active", turn off the LED
53+
digitalWrite(LED, LOW);
8754
}
8855
```
8956

@@ -96,23 +63,22 @@ You can set up **multiple scheduler variables.** This way, you can have a differ
9663
- Change a string.
9764

9865
```arduino
99-
//scheduler 1 (write a high state to a pin)
100-
if(schedule_variable_1.isActive()){
101-
digitalWrite(3, HIGH);
102-
}
103-
else{
104-
digitalWrite(3, HIGH);
66+
// scheduler 1 (write a high state to a pin)
67+
if (schedule_variable_1.isActive()) {
68+
digitalWrite(3, HIGH);
69+
} else {
70+
digitalWrite(3, LOW);
10571
}
10672
107-
//scheduler 2 (read a sensor)
108-
if(schedule_variable_2.isActive()){
109-
sensor_variable = analogRead(A1);
73+
// scheduler 2 (read a sensor)
74+
if(schedule_variable_2.isActive()) {
75+
sensor_variable = analogRead(A1);
11076
}
11177
112-
//scheduler 3 (change a string)
113-
if(schedule_variable_3.isActive()){
114-
string_variable = "";
115-
string_variable = "Update something here!";
78+
// scheduler 3 (change a string)
79+
if (schedule_variable_3.isActive()) {
80+
string_variable = "";
81+
string_variable = "Update something here!";
11682
}
11783
```
11884

@@ -122,14 +88,12 @@ string_variable = "Update something here!";
12288
Turning on and off light sources can be a great power saver for the office, home or vacation home. This can be achieved with a few lines of code and a [relay shield](https://store.arduino.cc/products/arduino-mkr-relay-proto-shield).
12389

12490
```arduino
125-
//can be configured to be ON between 8am - 5pm
126-
if(schedule_variable.isActive()){
127-
digitalWrite(relay, HIGH);
128-
}
129-
130-
//can be set to OFF between 5pm - 8am the next morning
131-
else{
132-
digitalWrite(relay, LOW);
91+
if (schedule_variable.isActive()) {
92+
// can be configured to be ON between 8am - 5pm
93+
digitalWrite(relay, HIGH);
94+
} else {
95+
//can be set to OFF between 5pm - 8am the next morning
96+
digitalWrite(relay, LOW);
13397
}
13498
```
13599

@@ -140,25 +104,21 @@ digitalWrite(relay, LOW);
140104
For a "smart watering" setup, if you connect a pump through a relay, you can schedule a job to be on for a period of time (pumping water) and then turn off. This could for example occur for a few seconds every day to keep your plants alive.
141105

142106
```arduino
143-
//configure to be "on" for 10 seconds every day
144-
if(schedule_variable.isActive()){
145-
digitalWrite(pump, HIGH);
146-
}
147-
148-
else{
149-
digitalWrite(pump, LOW);
107+
// configure to be "on" for 10 seconds every day
108+
if (schedule_variable.isActive()) {
109+
digitalWrite(pump, HIGH);
110+
} else {
111+
digitalWrite(pump, LOW);
150112
}
151113
```
152114

153115
Or, if you use a driver, such as **L298N**, you can control the pump through:
154116

155117
```arduino
156-
if(schedule_variable.isActive()){
157-
analogWrite(pump, 127); //range between 0-255
158-
}
159-
160-
else{
161-
analogWrite(pump, 0);
118+
if (schedule_variable.isActive()) {
119+
analogWrite(pump, 127); // range between 0-255
120+
} else {
121+
analogWrite(pump, 0);
162122
}
163123
```
164124

@@ -171,6 +131,24 @@ In this section you will find a step by step tutorial that will guide you to cre
171131
- Create a basic sketch & upload it to the board.
172132
- Create a dashboard.
173133

134+
### API
135+
136+
The two **variables types** introduced in this tutorial are `CloudTime` and `CloudSchedule`. These are used to retrieve local time and to schedule a job respectively.
137+
138+
The `CloudSchedule` variable is of a **complex type**. It has a **internal boolean state**, which can be checked through the `isActive()` function (returns `true` or `false`).
139+
140+
```arduino
141+
if(schedule_variable.isActive()) {
142+
//do something
143+
}
144+
```
145+
146+
The `CloudTime` variable is an unsigned integer which is used to store current time. We can use the `getLocalTime()` function to retrieve local time.
147+
148+
```arduino
149+
time_variable = ArduinoCloud.getLocalTime();
150+
```
151+
174152
### Create a Thing
175153

176154
***If you are new to the Arduino IoT Cloud, you can either visit the [Getting Started with Arduino IoT Cloud](https://docs.arduino.cc/cloud/iot-cloud/tutorials/iot-cloud-getting-started) guide, or any of the tutorials in the [Arduino IoT Cloud documentation](https://docs.arduino.cc/cloud/iot-cloud). There you will find detailed step by step guides.***
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Yún Rev2
3-
url_shop: https://store.arduino.cc/arduino-yun-rev-2
43
core: arduino:avr
4+
status: end-of-life
55
---
66

7-
The Yún Rev2, Linux powered board with the Arduino simplicity, is the perfect board for your IoT projects!
7+
The Yún Rev2, Linux powered board with the Arduino simplicity, is the perfect board for your IoT projects!
Loading

content/hardware/04.pro/boards/portenta-h7-lite-connected/compatibility.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ software:
55
- web-editor
66
- openmv-ide
77
hardware:
8+
boards:
9+
- nicla-sense-me
810
shields:
911
- portenta-vision-shield
10-
boards:
11-
- portenta-breakout
12+
- portenta-cat-m1-nb-iot-gnss-shield
13+
#- mkr-485-shield
14+
#- mkr-can-shield
15+
#- mkr-env-shield
16+
#- mkr-eth-shield
17+
#- mkr-gps-shield
18+
#- mkr-imu-shield
19+
#- mkr-mem-shield
20+
#- mkr-relay-proto-shield
21+
#- mkr-rgb-shield
22+
#- mkr-sd-proto-shield
23+
#- mkr-therm-shield
24+
carriers:
25+
- portenta-breakout
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
software:
22
- arduino-ide
33
- arduino-cli
4-
- iot-cloud
54
- web-editor
65
- openmv-ide
76
hardware:
7+
boards:
8+
- nicla-sense-me
89
shields:
910
- portenta-vision-shield
10-
boards:
11+
- portenta-cat-m1-nb-iot-gnss-shield
12+
#- mkr-485-shield
13+
#- mkr-can-shield
14+
#- mkr-env-shield
15+
#- mkr-eth-shield
16+
#- mkr-gps-shield
17+
#- mkr-imu-shield
18+
#- mkr-mem-shield
19+
#- mkr-relay-proto-shield
20+
#- mkr-rgb-shield
21+
#- mkr-sd-proto-shield
22+
#- mkr-therm-shield
23+
carriers:
1124
- portenta-breakout

content/hardware/04.pro/boards/portenta-h7/compatibility.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ software:
55
- web-editor
66
- openmv-ide
77
hardware:
8+
boards:
9+
- nicla-sense-me
810
shields:
911
- portenta-vision-shield
10-
boards:
11-
- portenta-breakout
12+
- portenta-cat-m1-nb-iot-gnss-shield
13+
#- mkr-485-shield
14+
#- mkr-can-shield
15+
#- mkr-env-shield
16+
#- mkr-eth-shield
17+
#- mkr-gps-shield
18+
#- mkr-imu-shield
19+
#- mkr-mem-shield
20+
#- mkr-relay-proto-shield
21+
#- mkr-rgb-shield
22+
#- mkr-sd-proto-shield
23+
#- mkr-therm-shield
24+
carriers:
25+
- portenta-breakout

content/hardware/04.pro/boards/portenta-h7/datasheets/datasheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Laboratory equipment, Computer vision
5555
<tr>
5656
<td style="text-align: center;">Connectivity</td>
5757
<td style="text-align: center;">Ethernet PHY / Wi-Fi® / Bluetooth® Low Energy (BLE 5 via Cordio stack, BLE 4.2 via Arduino Stack)</td>
58-
<td style="text-align: center;">Ethernet FHY</td>
58+
<td style="text-align: center;">Ethernet PHY</td>
5959
<td style="text-align: center;">Ethernet PHY / Wi-Fi® / Bluetooth® Low Energy (BLE 5 via Cordio stack, BLE 4.2 via Arduino Stack)</td>
6060
</tr>
6161
<tr>

content/hardware/04.pro/boards/portenta-x8/product.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Portenta X8
3+
url_shop: https://store.arduino.cc/portenta-x8
34
url_guide: /software/ide-v1/tutorials/getting-started/cores/arduino-mbed_portenta
45
core: arduino:mbed_portenta
56
---

content/hardware/04.pro/carriers/edge-control/compatibility.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@ software:
44
- iot-cloud
55
- web-editor
66
hardware:
7+
boards:
8+
- portenta-h7
9+
- portenta-h7-lite
10+
- portenta-h7-lite-connected
11+
- portenta-vision-shield
12+
#- mkr-1000-wifi
13+
#- mkr-fox-1200
14+
- mkr-gsm-1400
15+
#- mkr-nb-1500
16+
#- mkr-vidor-4000
17+
#- mkr-wan-1300
18+
#- mkr-wan-1310
19+
- mkr-wifi-1010
20+
#- mkr-zero
721
shields:
822
- vision-shield-lora
923
- vision-shield-ethernet
10-
boards:
24+
- mkr-env-shield
25+
carriers:
1126
- portenta-breakout

content/hardware/04.pro/carriers/portenta-machine-control/compatibility.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ software:
55
- web-editor
66
hardware:
77
boards:
8-
- portenta-h7
9-
8+
- portenta-h7

content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/compatibility.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ hardware:
66
boards:
77
- portenta-breakout
88
- portenta-h7
9+
- portenta-h7-lite
10+
- portenta-h7-lite-connected

content/hardware/04.pro/shields/portenta-vision-shield/compatibility.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ software:
44
- iot-cloud
55
- web-editor
66
- openmv-ide
7-
boards:
8-
- portenta-h7
7+
8+
hardware:
9+
boards:
10+
- portenta-h7
11+
- portenta-h7-lite
12+
- portenta-h7-lite-connected

0 commit comments

Comments
 (0)