wondering if anyone can help. I have a homemade board with an Atmega16u2, been using it for months on two different projects with no problem.
the 16u2 has an arduino bootloader, that i installed with avrdude, called Hoodloader2 (bootloader code and board file by GitHub - NicoHood/HoodLoader2: 16u2 Bootloader to reprogram 16u2 + 328/2560 with Arduino IDE).
i recently added some new statements in my code and i got compile errors:
#define capground A2
error: 'A2' was not declared in this scope
ACMUX = 3
error: 'ACMUX' was not declared in this scope
i also have this statement ACSR |= (1<<7); which the compiler does recognize. The ACSR and ACMUX are registers for the analog comparator.
i'm guessing there's an error in the board file, but God knows where it is. Has anyone else ever used Hoodloader2?
"The ATmega16U2 doesn't have an ADC"
even if it did it would only have a resolution of 5mV so i would still need to use the comparator to get single mV measurements