Simulator

Arduino Leonardo simulator, running in this tab

Mokxi is a free Arduino Leonardo simulator that runs in your browser, with nothing to install and no account needed. The Leonardo is the Arduino whose USB socket goes to the chip: `Serial` is a USB CDC endpoint and `Serial1` is the UART on pins 0 and 1. An ATmega32U4 at 16 MHz on an Uno's outline. Wire the circuit, write the sketch, press Run.

  • 192parts on the bench
  • 25boards running now
  • 1.00xreal time, on every board
Arduino Leonardo: blinklive0.000 s 0.00x
Click to open it in the editor
Real firmware, running right now on our own core. Click it to open the circuit in the editor.
What is modeled

The numbers, not the marketing

Taken from the board's own contract document and put in plain words.

The core
Every ATmega32U4 mnemonic at 16 MHz, with the datasheet cycle count for each one.
Two serial ports, and they are different things
Serial is the USB device on the die, modeled as a byte pipe at the real endpoint registers. Serial1 is the USART on pins 0 and 1, shifting real 8N1 frames.
A timer nothing else here has
Timer 4 is ten bits wide with TOP in a register and channels A, B and D. It drives pins 6 and 13, and analogWrite hides all of it.
Go further

The full board page

Every peripheral area, every example and the wiring notes, in one place.

Arduino Leonardo simulatorBlink, a button and the serial monitor, running.

Questions

Is it free?

Yes, all of it, with no card and no account needed to try it.

Why is Serial not a UART here?

Because on a Leonardo it is not one. The USB socket goes to the ATmega32U4 itself, so Serial is a CDC endpoint the sketch opens and Serial1 is the real USART on pins 0 and 1.

Can it pretend to be a keyboard?

Not in Mokxi. Keyboard and Mouse need the USB stack above the byte pipe, and the model does not have one. The board page says so plainly.

Will an Uno sketch run on it?

The source usually will; the ELF will not, because it is a different chip. Watch for SDA and SCL, which are pins 2 and 3 here rather than A4 and A5.

Try your own firmware on the Leonardo

What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.