Pin names
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:On board LEDs
The board includes four LEDs:
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:
Simulation features
The Arduino Mega 2560 is simulated using the AVR8js Library. The table below summarizes the status of features:
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.
Serial Monitor
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. toSerial2 instead of Serial), and how to configure the line ending characters.