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

Moderator: igrr

User avatar
By Ribeiro Santos
#15486 Hi,

I'm learning to create libraries to ESP8266 to use in Arduino IDE.

Lot of code has, by example:
#if defined(__AVR__)
#include <TFT_Arduino_Mega.h>
#else
#include <TFT_Arduino.h>
#endif

where is "__AVR__" defined and/or where is the equivalent to the ESP board?

Thanks a lot,
Ribeiro
User avatar
By Chris--A
#15490 It doesn't matter where its defined (__AVR__), its only meant for AVR processors.

As for the ESP. The IDE version 1.6.1 outputs the following definitions:

ARDUINO_ESP8266_ESP01
ARDUINO_ARCH_ESP8266

Using the second one is probably better (seems less likely to change).
These aren't added by the Espressif core, but in the the IDE using -D compiler options.