Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
npm install avr8jsAVR8js
Pre-Compiled machine code --> AVR8js <--> Glue code <--> external hardware functional simulation <--> simulation state display for the user
`
You may be interested in exploring the wokwi-elements collection of web-components for visual representations of many common hardware components. (Note: these are visual only elements- you will need to add the appropriate functional simulation and glue code.)
$3
A step-by-step video tutorial showing how to build a simple Arduino simulator using AVR8js and React:

And a related blog post.
$3
These examples show working examples of using avr8js in an application. Many of them also demonstrate how to use the wokwi-elements and include working examples of functional simulations of the components, and how to hook them up to avr8js.
* Minimal Example
* 6 LEDs
* LED PWM
* Serial Monitor
* NeoPixel Matrix
* Arduino MEGA NeoPixel Matrix
* Simon Game - with pushbuttons and sound
* XMAS LEDs
* Assembly Code
* EEPROM persistence
Note: they are all hosted outside of this repo.
Running the demo project
The demo project allows you to edit Arduino code, compile it, and run it in the simulator.
It also simulates 2 LEDs connected to pins 12 and 13 (PB4 and PB5).
To run the demo project, check out this repository, run npm install and then npm start.
Which chips can be simulated?
The library focuses on simulating the ATmega328p, which is the MCU used by the Arduino Uno.
However, the code is built in a modular way, and is highly configurable, making it possible
to simulate many chips from the AVR8 family, such as the ATmega2560 and the ATtiny series:
* ATtiny85 Simulation
Check out issue 67 and
issue 73 for more information.
Running the tests
Run the tests once:
`
npm test
`
Run the tests of the files you modified since last commit (watch mode):
`
npm run test:watch
``