Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By gerardwr
#26196
martinayotte wrote:ARDUINO is for the IDE. For Atmel MCU, there are some flags like __AVR_ATmega8__, __AVR_ATmega328P__, __AVR_ATmega32U4__, __AVR_ATmega2560__ and so on, there are about 50 flavors. There are other flags for board types, such as AVR_UNO, AVR_NANO, AVR_MEGA2560 and so on ...


Thanks for your reply.

I checked the io.h file for __AVR_AT... defines and I saw >250+ defines.

As I use sketches that run on AtMega328 AVR's (UNO, Nano or Micro) or ESP I decided do use this:
Code: Select all  #if defined (__AVR_ATmega328P__)
    Serial.println();
    Serial.println(F("Now monitoring changes on Arduino INT0/D2"));
    intpin=0;
  #endif
  #if defined(ESP8266)
    Serial.println(F("Version compiled for ESP8266. Now monitoring changes on ESP8266 GPIO2"));
    intpin=2;
  #endif


Thanks for your help!