Closed elliottkember closed 4 years ago
Example for Arduino Mega 2560 + FastLED simulation:
https://stackblitz.com/edit/avr8js-mega-ws2812?file=execute.ts
In particular, the following changes are required when initializing the simulation:
this.cpu = new CPU(this.program, 0x2200);
this.timer = new AVRTimer(this.cpu, {
...timer0Config,
compAInterrupt: 0x02a,
compBInterrupt: 0x02c,
ovfInterrupt: 0x02e,
});
In order to run generic Arduino Mega 2560 simulation, some more changes are needed. For instance, the Mega has 6 timers while the Uno only has 3 timers, more GPIO ports, etc.
Would love to see an Arduino Mega 2560 version! I hit the Uno memory limits pretty quickly using FastLED, so the extra memory would be super helpful.