I would like to identify the target where I'm downloading my Arduino code. Following this example:
I'm able to recognize for example Arduino Mini, etc.. but Arduino Every, quite new board is not in the list and I don't understand where to find the correct "define" name to add in the list. Can someone help me? Thanks Andrea.
1 Answer 1
According to documentation the macro to identify the Arduino board is generated as as ARDUINO_{build.board}
where {build.board}
is from boards.txt file of the 'platform'.
Nano Every has in boards.txt nona4809.build.board=AVR_NANO_EVERY
.
So the macro to identify Nano Every is ARDUINO_AVR_NANO_EVERY
.
-
1Great! I was not aware of this documentation. It works perfectly, thanks a lot! I also found that if you need to know if the emulator mega 328 is selected, you can use: #elif defined(AVR_NANO_4809_328MODE) #define BOARD F("Every 328 emul") #elif defined(ARDUINO_AVR_NANO_EVERY) #define BOARD F("Every") But your answer solved my problem. Many thanksAndrea Guglielmi– Andrea Guglielmi2021年07月25日 12:24:11 +00:00Commented Jul 25, 2021 at 12:24
_AVR_CPU_NAME_
helps.%HOMEPATH%\AppData\Local
for an Arduino folder. The Arduino.h header it uses is likely there underpackages\arduino\hardware\megaavr