Arduino Mega 2560. Powered by the ATmega2560 chip, which has 256K bytes of Flash program memory, 8k bytes of SRAM and 4K bytes of EEPROM. The board features 54 digital pins, 16 analog input pins, and 4 serial ports. It runs at 16MHz.
Pins 0 to 53 are digital GPIO pins. Pins A0 to A15 double as analog input pins, in addition to being digital GPIO pins.
There are five ground pins: GND.1 (next to pin 13), GND.2/GND.3 (next to the Vin pin), and GND.4/GND.5 (at the bottom of the dual-row female header connector)
Pins VIN / 5V are connected to the positive power supply. There are also two additional power supply pins, 5V.1/5V.2, at the top of the dual-row female header connector.
Pins 3.3V / IOREF / AREF / RESET are not available in the simulation.
Digital pins 2 … 13, 44, 45, and 46 have hardware PWM support (total of 15 PWM channels).
Some of the digital pins also have additional functions:
|53||SPI||SS (Chip select)|
On board LEDs
The board includes four LEDs:
|L||Connected to digital pin 13|
|RX||Serial RX Activity|
|TX||Serial TX Activity|
|ON||Power LED. Always on while the simulation is running|
In general, only the "L" LED can be controlled by the user's code. You can use the
LED_BUILTIN constant to reference it from your code:
See Blink for a complete code example.
The Arduino Mega 2560 is simulated using the AVR8js Library. The table below summarizes the status of features:
|GPIO||✔️||Including External/Pin Change Interrupts|
|8-bit timers||✔️||Timer0, Timer2|
|16-bit timers||✔️||Timer1, Timer3, Timer4, Timer5 *|
|Output Compare Modulator||❌|
|USART||✔️||USART0, USART1, USART1, USART3|
|SPI||🟡||Master mode only|
|I2C||🟡||Master mode only|
|ADC||✔️||Used by analogRead()|
|GDB Debugging||✔️||See the GDB Debugging Guide|
Legend: ✔️ Simulated 🟡 Simulated, but see notes ❌ Not implemented
* Input Capture is not implemented in the 16-bit timers.
If you need any of the missing features, please open an issue on the AVR8js repo or reach out on Discord.
You can use the Serial Monitor to receive information from your Arduino code, such as debug print. You can also use it to send information to your code, such as textual commands.
For more information and code samples, check out the Serial Monitor guide. It also explains how to connect the serial monitor to a different pin (e.g. to
Serial2 instead of
Serial), and how to configure the line ending characters.
The simulator supports many popular Arduino libraries. For a complete list, see the Libraries guides.