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/02.hero/boards/uno-r4-wifi/tutorials/cheat-sheet/cheat-sheet.md
+88-5Lines changed: 88 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
---
2
2
title: 'Arduino UNO R4 WiFi Cheat Sheet'
3
-
description: 'Learn how to set up the Arduino UNO R4 WiFi, the '
3
+
description: 'Learn how to set up the Arduino UNO R4 WiFi, the fourth revision of our most popular and important development board.'
4
4
tags:
5
5
- Installation
6
6
- I2C
7
7
- SPI
8
8
- UART
9
9
- WiFi
10
10
- Bluetooth
11
-
-
12
11
author: 'Jacob Hylén'
13
12
hardware:
14
13
- hardware/02.hero/boards/uno-r4-wifi
@@ -20,7 +19,7 @@ software:
20
19
21
20
The **Arduino UNO** is our most popular and important line of development boards, and has become a staple in the maker community and education since its release. The **Arduino UNO R4 WiFi** is a new flavour of UNO, and in this cheat sheet you will a collection of links to resources and guides to let you take advantage of all the improvements from the previous revisions of this board. The **UNO R4 WiFi** comes with a large 12x8 LED Matrix that you can create animations and simple graphics with, as well as an onboard ESP32-S3 module giving the board WiFi and Bluetooth functionality.
22
21
23
-
The ESP32 module and the Renesas RA4M1-chip are part of a sophisticated USB-Serial system that is highly flexible and adaptible to allow for HID features while still keeping the ability to program both the main MCU, and the ESP32, if you so wish.
22
+
The ESP32 module and the Renesas RA4M1-chip are part of a sophisticated USB-Serial system that is highly flexible and adaptive to allow for HID features while still keeping the ability to program both the main MCU, and the ESP32, if you so wish (Although this is an advanced option and requires some hacking).
24
23
25
24
You can also visit the documentation platform for the [Arduino UNO R4 WiFi](/hardware/uno-r4-wifi)
26
25
@@ -30,6 +29,90 @@ The full datasheet is available as a downloadable PDF from the link below:
30
29
-[Download the UNO R4 WiFi datasheet](/resources/datasheets/ABX00087-datasheet.pdf)
31
30
32
31
## Arduino IoT Cloud
33
-
The GIGA R1 WiFi is compatible with the [Arduino IoT Cloud](https://create.arduino.cc/iot/things), a cloud service that allows you to create IoT applications in just minutes.
32
+
The Arduino UNO R4 WiFi is compatible with the [Arduino IoT Cloud](https://create.arduino.cc/iot/things), a cloud service that allows you to create IoT applications in just minutes.
34
33
35
-
***Visit the [Getting Started with Arduino IoT Cloud](/arduino-cloud/getting-started/iot-cloud-getting-started) guide for more information.***
34
+
***Visit the [Getting Started with Arduino IoT Cloud](/arduino-cloud/getting-started/iot-cloud-getting-started) guide for more information.***
35
+
36
+
## ESP32
37
+
By default, the ESP32-S3 module onboard the UNO R4 WiFi is acting as a Serial bridge, handling the connection to your computer as well as rebooting the main MCU, the Renesas RA4M1 when it is needed, for example when receiving a new sketch and resetting. On the UNO R3, there is an ATMEGA16U2 serving this exact purpose. The difference here is that the ESP32-S3 is much more capable, and the UNO R4 WiFi takes advantage of those capabilities by using its connectivity features, as well as exposing the ESP32s data lines to make it programmable by itself.
38
+
39
+

40
+
41
+
The way this is implemented on the UNO R3 also means that the board is not able to emulate an HID device, such as a keyboard or a mouse. This is, however, not true for the UNO R4.
42
+
43
+
### USB Bridge
44
+
As mentioned, by default the ESP32 is acting as a serial bridge, however if you wish you can change this and get direct access to the serial bus on the RA4M1 MCU either with software or hardware.
45
+
46
+
1. Software - By pulling D40 to HIGH you will close the circuit that controls which MCU is connected to USB. While D40 is HIGH, the RA4M1 is connected to the USB Serial port.
47
+
You can do this by including the following code in `void setup()`
48
+
```arduino
49
+
pinMode(40, OUTPUT);
50
+
digitalWrite(40, HIGH);
51
+
```
52
+
2. On the back of the UNO R4 WiFi you will find solder pads labelled "RA4M1 USB". If you create a short circuit between these pads, by for example creating a bridge across them with solder, the RA4M1 will be connected to the USB Serial port, instead of the ESP32.
53
+
54
+

55
+
56
+
### WiFi
57
+
58
+
### Bluetooth
59
+
60
+
### Programmable (Advanced)
61
+
A more advanced user will be able to program the ESP32 individually from the RA4M1, and even integrate them with each other to create what is esentially a multi-core development board. You could for example use the RA4M1 chip to read sensordata with high speed and send it to the ESP32 where it gets processed and then sent to a webserver, or logged in a spreadsheet, all without adding any extra hardware to your board apart from the sensors.
62
+
63
+
To reprogram the ESP32 board you can find UART-pads next to the ESP32 Module, that are laid out as shown in the image below:
64
+
65
+

66
+
67
+
## LED Matrix
68
+
The LED Matrix on the UNO R4 WiFi is available to use in your program, to display still graphics, animations, or even play games on. Bundled in the core for the UNO R4 is a library for displaying frames on the matrix.
69
+
70
+
### LED_Matrix
71
+
Initialise a LED_matrix by for example adding this code to the start of your sketch:
72
+
```arduino
73
+
LED_matrix matrix;
74
+
```
75
+
76
+
### LED_Matrix.load()
77
+
If you've written your sketch to hold your frames as child-arrays inside of a parent-array, `load()` can be used to load the parent-array, as such:
78
+
79
+
```arduino
80
+
// creates an array of two frames
81
+
const uint32_t frames[][4] = {
82
+
{
83
+
0x0,
84
+
0x0,
85
+
0xc00c0000,
86
+
150
87
+
},
88
+
{
89
+
0x0,
90
+
0x1e01,
91
+
0x201201e0,
92
+
150
93
+
}
94
+
}
95
+
96
+
// loads the frames into the matrix buffer
97
+
matrix.load(frames);
98
+
99
+
```
100
+
101
+
### LED_Matrix.begin()
102
+
The `begin()` method starts displaying the frames you have loaded into the matrix buffer one after the other.
103
+
104
+
### LED_Matrix.autoscroll()
105
+
`autoscroll()` lets you set an automatic time interval for the matrix to move to the next frame, and is used as such:
106
+
107
+
```arduino
108
+
matrix.autoscroll(300);
109
+
```
110
+
111
+
### LED_Matrix.next()
112
+
`next()` will manually let you move to the next frame, if the autoscroll is not suitable for your program.
0 commit comments