Arduino Leonardo simulator, with Serial on the USB
The Leonardo is the Arduino whose USB socket goes to the microcontroller. An ATmega32U4 at 16 MHz on an Uno's outline: the same shield headers, and a `Serial` that is a USB CDC endpoint rather than a UART, with `Serial1` on pins 0 and 1 as a port of its own.
- 8peripheral areas modeled
- 4projects ready to run
- Real timeon your own machine
What is modeled
Taken from the board's own contract document and put in plain words, with what is missing listed underneath.
Not in the model
- The USB stack above the byte pipe: no enumeration, no descriptors, no SETUP. `while (!Serial)` returns at once here and waits on a desk.
- Keyboard and Mouse. They are the other half of what a 32U4 is for, and they need the stack that is not there.
- SPI, TWI, the analog comparator, the watchdog, and the PLL that would clock timer 4 faster than 16 MHz.
- The Leonardo ETH. The Micro and the Pro Micro are the same chip on other pinouts, and have pages of their own.
Open one and press Run
Each of these opens in the editor exactly as it is drawn here.
Every built-in project on the Leonardo
Each has its own page with the circuit running, the code and a parts list.
Arduino libraries that compile as they are
Paste a tutorial that includes one of these and it builds: each is written for Mokxi, on its own drivers, under the name the tutorials use. For any other library the build names the Mokxi header that does the same job.
Questions
Is it free?
Yes. Every board and every part is on the free plan, with no account needed.
Why is Serial different from an Uno’s?
Because the hardware is. On an Uno a separate chip turns USB into a UART, so Serial is USART0. On a Leonardo the USB goes to the ATmega32U4 itself, so Serial is a CDC endpoint and Serial1 is the UART on pins 0 and 1.
Can I make it act as a keyboard?
Not here. Keyboard and Mouse need the USB stack above the byte pipe, and the model says plainly that it does not have one.
Will an Uno sketch run on it?
The source usually will. The ELF will not: it is a different chip with a different register map. And SDA and SCL are pins 2 and 3 here, not A4 and A5.
The other boards
Every one of these runs today, and every one is free.
Looking for the shorter introduction? See the Arduino Leonardo simulator page.
Try it on your own firmware
What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.