Hello, I’ve added atmega1284P support to emonlib by adding these two lines of code in EmonLib.cpp, readVcc function:
#elif defined(AVR_ATmega1284) || defined(AVR_ATmega1284P)
ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
The library will then work with the 644/1284 MightyCore.
I didn’t check if they are also good for 644.
May you include them in a future release of the library?