Skip to content

Commit 0b6adef

Browse files
committed
User Manual writing commit 19
1 parent 34cf055 commit 0b6adef

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed
6.97 MB
Loading
9 Bytes
Loading
115 KB
Loading

content/hardware/05.pro-solutions/solutions-and-kits/edge-control/tutorials/user-manual/content.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,14 @@ void loop()
959959
}
960960
```
961961
962+
### Power Rails
963+
964+
The Edge Control let you manage the power state of several internal components, so energy efficient applications could be achieved using this board.
965+
966+
The different commands and controllable power rails will be specified in the list below:
967+
968+
969+
962970
## Edge Control Enclosure Kit
963971
964972
![Edge Control Enclosure Kit](assets/EnclosureKit-low.png)
@@ -1164,7 +1172,9 @@ while (Wire.available()) {
11641172
}
11651173
```
11661174

1167-
In the example code below, we are going to communicate the Edge Control with a MKR WiFi 1010. With a potentiometer connected to the Edge Control, the onboard LED of the MKR board will be controlled, so we will be sending the brightness value through I2C to it.
1175+
In the example code below, we are going to communicate the Edge Control with a MKR WiFi 1010. With a potentiometer connected to the Edge Control, the onboard LED of the MKR board will be controlled, so we will be sending the brightness value through I2C to it.
1176+
1177+
***Use the same connection from [this section](#analog-inputs) for the potentiometer wiring.***
11681178

11691179
![Demo wiring - MKR WiFi 1010 on slot 1 of the Edge Control](assets/i2c-wiring.png)
11701180

@@ -1382,8 +1392,61 @@ Serial1.println("Hello world!");
13821392

13831393
To learn more about how to communicate the Edge Control through UART with other devices, we will use the example code below that can be found on **File > Examples > Arduino_EdgeControl > RPC > BlinkOverSerial**
13841394

1385-
This example shows how to export Arduino functions as remote procedure calls (RPC), the Edge Control is capable ofcontrolling a MKR board built-in LED by Serial communication.
13861395

1396+
This example shows how to export Arduino functions as remote procedure calls (RPC), the Edge Control is capable of controlling a MKR board built-in LED by Serial communication.
1397+
1398+
![Connections for the UART example](assets/uart-wiring.png)
1399+
1400+
#### Edge Control Code
1401+
1402+
```cpp
1403+
#include <Arduino_EdgeControl.h>
1404+
1405+
bool led { false };
1406+
1407+
void setup()
1408+
{
1409+
EdgeControl.begin();
1410+
Power.on(PWR_3V3);
1411+
Power.on(PWR_VBAT);
1412+
Power.on(PWR_MKR2);
1413+
1414+
// Wait for MKR to power on
1415+
delay(5000);
1416+
1417+
SerialMKR2.begin(9600); // must be the same on both devices
1418+
while (!SerialMKR2) {
1419+
delay(500);
1420+
}
1421+
}
1422+
1423+
void loop()
1424+
{
1425+
SerialMKR2.write(led);
1426+
led = !led;
1427+
delay(1000);
1428+
}
1429+
```
1430+
1431+
#### MKR Code
1432+
1433+
```cpp
1434+
void setup() {
1435+
Serial1.begin(9600); // must be the same on both devices
1436+
pinMode(LED_BUILTIN, OUTPUT);
1437+
digitalWrite(LED_BUILTIN, LOW);
1438+
1439+
delay(1000);
1440+
}
1441+
1442+
void loop() {
1443+
if (Serial1.available()) {
1444+
auto c = Serial1.read();
1445+
digitalWrite(LED_BUILTIN, c);
1446+
}
1447+
}
1448+
```
13871449

1450+
![UART communication demo](assets/UART.gif)
13881451

13891452
### Bluetooth® Low Energy

0 commit comments

Comments
 (0)