chipKIT® Development Platform

Inspired by Arduino™

Last edit: 2021-03-21 22:34 by Majenko

Board Define

The "Board Define" is a preprocessor macro which identifies to your code which board you are compiling for.

This is provided in the "boards.txt" or "board.txt" file for Arduino and UECIDE respectively and is appended to the compilation command as a "-D" switch.

Using these you can optionally compile different parts of your code - great for selecting different pins on different boards without having to change settings every time you want to compile for a different board.

#if defined(BOARD_UNO) // Code specific to the UNO32 goes here #elif defined(BOARD_LENNY) // Code specific to the Lenny goes here #endif