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
+111-5Lines changed: 111 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,113 @@ 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
+
## QWIIC Connector
37
+
38
+
The Arduino UNO R4 WiFi features a QWIIC/STEMMA connector that you can use to connect modules, often allowing you to daisychain several modules and control all of them through the single connector.
39
+
40
+
QWIIC or STEMMA are both names for a type of connector developed by SparkFun and Adafruit respectively, that bundles the I2C pins of a development board and breakout modules. What this means is that if you have a development board (such as for example the Arduino UNO R4 WiFi) and a breakout module, and both have a QWIIC or STEMMA connector, you can hook them up together and with absolutely minimal wiring you can quickly create multi-faceted projects.
41
+
42
+
If your breakout board features more than one of these connector, which many do, you can use the second one to daisychain *another* QWIIC module to add another interactive node to your project.
43
+
44
+
The Arduino UNO R4 WiFi features two I2C buses, and the QWIIC connector is connected to the secondary one. What this means is that if you are using the [Wire](https://reference.arduino.cc/reference/en/language/functions/communication/wire/) library, you use the `Wire1` object rather than the `Wire` object, like this:
45
+
46
+
```arduino
47
+
#include <Wire.h>
48
+
49
+
void setup(){
50
+
Wire1.begin();
51
+
Wire1.beginTransmission(1); //begin transmit to device 1
52
+
Wire1.write(byte(0x00)); //send instruction byte
53
+
Wire1.write(val); //send a value
54
+
Wire1.endTransmission(); //stop transmit
55
+
}
56
+
```
57
+
58
+
59
+
## ESP32
60
+
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.
61
+
62
+

63
+
64
+
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.
65
+
66
+
### USB Bridge
67
+
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.
68
+
69
+
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.
70
+
You can do this by including the following code in `void setup()`
71
+
```arduino
72
+
pinMode(40, OUTPUT);
73
+
digitalWrite(40, HIGH);
74
+
```
75
+
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.
76
+
77
+

78
+
79
+
### WiFi
80
+
81
+
### Bluetooth
82
+
83
+
### Programmable (Advanced)
84
+
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 essentially 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.
85
+
86
+
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:
87
+
88
+

89
+
90
+
## LED Matrix
91
+
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.
92
+
93
+
### LED_Matrix
94
+
Initialise a LED_matrix by for example adding this code to the start of your sketch:
95
+
```arduino
96
+
LED_matrix matrix;
97
+
```
98
+
99
+
### LED_Matrix.load()
100
+
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:
101
+
102
+
```arduino
103
+
// creates an array of two frames
104
+
const uint32_t frames[][4] = {
105
+
{
106
+
0x0,
107
+
0x0,
108
+
0xc00c0000,
109
+
150
110
+
},
111
+
{
112
+
0x0,
113
+
0x1e01,
114
+
0x201201e0,
115
+
150
116
+
}
117
+
}
118
+
119
+
// loads the frames into the matrix buffer
120
+
matrix.load(frames);
121
+
122
+
```
123
+
124
+
### LED_Matrix.begin()
125
+
The `begin()` method starts displaying the frames you have loaded into the matrix buffer one after the other.
126
+
127
+
### LED_Matrix.autoscroll()
128
+
`autoscroll()` lets you set an automatic time interval for the matrix to move to the next frame, and is used as such:
129
+
130
+
```arduino
131
+
matrix.autoscroll(300);
132
+
```
133
+
134
+
### LED_Matrix.next()
135
+
`next()` will manually let you move to the next frame, if the autoscroll is not suitable for your program.
0 commit comments