A virtual machine for Arduino, allowing dynamic program updates.
Based on my implementation of CHIP-8, where the gaming related instructions are removed, and instead instructions for IO pin controlling are added.
The following instructions that are related to games (drawing, etc.) are removed:
The following instructions that are related to IO control are added:
EXA1– sets the pin mode X to the pin (value in first register)
analogReadto the first register and stores the result in the second register
analogWriteto the first register using the value from the second register
E0A4– sleep for second register’s value milliseconds
Registers are changed from 8 bit to 16 bit.
In order to reload a program, use the
0000 instruction to halt the VM and restart.
Tested on ESP32 Arduino (LOLIN D32).