Tutorials¶
Start with Start here: VS Code: it installs MicroGoose and sets up VS Code, where you write a program, see its mistakes as you type, and press Ctrl+Shift+B to build it, flash it to your board and see what it prints.
Then four tutorials take you from a first program to one that reads a knob and turns a servo. Each one runs:
- On a board, from VS Code: an ESP32 or ESP32-S3 on your desk, with LEDs and a button on a breadboard.
- With no board, in your browser: Velxio is a free ESP32 simulator, where you see the LEDs light and click the button.
- With no board, in an emulator: QEMU runs the same firmware and shows what it prints in VS Code's terminal, not the pins, so it suits tutorial 2 best.
The programs are the same in all three.
| Tutorial | You learn | Time |
|---|---|---|
| Start here: VS Code | install MicroGoose, set up VS Code, run a program on your board with one key | 15 minutes |
| 1. Your first program: a traffic light | open an example, run it, read it, change it | 20 minutes |
| 2. Goose for Arduino and MicroPython programmers | the language: values, loops, functions, structs, arrays, text | 30 minutes |
| 3. LEDs and a button | outputs, inputs, and events that wake the program when a button is pressed | 30 minutes |
| 4. A knob, a dimmer and a servo | reading a voltage, PWM brightness, servo pulses | 30 minutes |
Do them in order: each one uses what the one before set up. The first build for a board takes a few minutes while MicroGoose downloads its toolchain. After that, a build takes seconds.
What you need¶
- A computer with Windows, macOS or Linux, Python 3.10 or newer, and VS Code.
- A board, or a web browser for Velxio.
- Nothing else: MicroGoose downloads the compilers and tools for the board itself.
If you have a board¶
Each tutorial's On a board tab is written for two boards:
- ESP32 DevKit V1, or any board with an ESP32 WROOM-32 or WROVER-E module. This is the board Velxio simulates, so its pin numbers are the ones in the tutorials.
- ESP32-S3-DevKitC-1. Its pins are numbered differently: each tutorial gives the S3's pin numbers in a table.
For tutorials 3 and 4 you also need a few parts, all in most starter kits:
| Part | For |
|---|---|
| a breadboard and jumper wires | connecting the parts without soldering |
| 3 LEDs (red, yellow, green) and 3 resistors of 220 Ω | tutorial 3; one LED and resistor in tutorial 4 |
| a push button | tutorial 3 |
| a 10 kΩ potentiometer (a knob) | tutorial 4 |
| a hobby servo (SG90 or similar) | tutorial 4 |
The STM32H743 runs these programs too, with its own pin numbers
(port × 16 + n: see Boards).
Stuck?¶
- The
microgoosecommand isn't found, or Windows blocks it: typepython -m microgoosewherever these pages saymicrogoose. Getting started explains why. - VS Code says
cannot find the module mcu, or checks nothing: open the project's own folder (the one withmain.gooseand.vscode), and trust it when VS Code asks. For a folder thatmicrogoose newdidn't make, runmicrogoose vscode FOLDER/main.gooseonce. - A board isn't found: Choosing the serial port. A USB cable that only charges, with no data lines, is a common cause.
- Something else, or a step that doesn't do what the page says: open an issue. Say which tutorial and step, and paste what the command printed.