LESSON 00 / Year 12 · Getting started
Understand the board.
Observe, identify and upload.
01 / What a microcontroller does
A microcontroller runs a program stored in memory. It reads inputs, performs calculations and controls outputs. It is often embedded in an object and repeats a specific task.
On the UNO R4, the RA4M1 is the main processor. The WiFi version adds an ESP32-S3 for wireless communication; choose “Arduino UNO R4 WiFi” in the IDE, not an ESP32 board.
02 / Prepare the workstation
- Install Arduino IDE from Arduino.
- In Boards Manager, install Arduino UNO R4 Boards by Arduino.
- Connect only USB-C using a data cable. Choose the exact board and its port in Tools.
- Open the first project, click Verify, then Upload.
- For lessons using the serial port, open the monitor at 115200 baud.
Each project is in a folder with the same name as its .inofile. Verification compiles the program; uploading sends it to the board.
If the port is missing, check the cable, then board selection. If a board is unresponsive, follow Arduino's reset procedure.
03 / Identify the pins
| Label | Role |
|---|---|
| D2, D4, D8… | Digital inputs or outputs: button, DS18B20, LED |
| A0 | Analogue input used for the potentiometer; also has a DAC function |
| D9 / PWM | Pulse-width modulated output |
| 5V / GND | Power supply and common reference |
| USB-C | Power and uploading for these lessons |
04 / Read the program
void setup() {
// Exécuté une fois au démarrage.
}
void loop() {
// Répété continuellement.
}| Syntax | Meaning |
|---|---|
constexpr uint8_t LED = 8; | Constant: the pin does not change. |
bool allumee = false; | A variable that is true or false. |
if (condition) { … } | Execute if the condition is true. |
millis() | Time in milliseconds since startup; the counter eventually overflows. |
// comment | An explanation for the reader; not executed. |
YOUR TURN / YEAR 12
For an automatic barrier, give an input, a processing step and an output.
GOING FURTHER / YEAR 13
Why separate information and energy when controlling a motor?
Suggested answers
The detector acquires a presence signal; the program decides; an output controls a power stage. Motor energy comes from a suitably sized supply, not the GPIO.
SOURCES AND FURTHER READING
Check the documentation.
- Arduino UNO R4 Minima · UNO R4 WiFi
- Arduino: analogue converter resolution
- Arduino: WiFiS3 examples
- Analog Devices : DS18B20
- OneWire · DallasTemperature
- Éduscol: STI2D curricula and resources
Original Quiet Bee content. A suggested progression for working on the information chain, prototyping and validation; it does not replace the curriculum or your teacher's instructions.