Atmega328P PU vs AU

Dear all,

I'm new to Arduino and I am trying to figure out how to identify if the code is running inside an Atmega328P-PU or AU which has 2 extra analog pins.

Anyone has an idea?

Thanks for your time
X

#if NUM_ANALOG_INPUTS == 8
    // Running on a chip with 8 analog inputs
#endif

This works because of the:

name.build.variant=eightanaloginputs

in boards.txt which selects hardware/arduino/variants/eightanaloginputs/pins_arduino.h which contains:

#undef NUM_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS           8

Amazing!! :slight_smile: Perfect and thanks a lot!

I used it as follows:

//Identify which uController is running this code
boolean fullFeatures = NUM_ANALOG_INPUTS == 8;

Cheers :slight_smile: