RasPiArduino
RasPiArduino copied to clipboard
Choose compile time symbolic for the "PiDuino" board
From the Arduino IDE perspective, the Pi appears as a new board type. When a sketch is being compiled the sketch can make reference to the "type" of board it is being compiled for. An example of this can be see here in the popular "firmata" project:
https://github.com/firmata/arduino/blob/master/Boards.h
In there, we find the existence of some boards by name. These include:
__AVR_ATmega168____AVR_ATmega328P____AVR_ATmega328____AVR_ATmega8____AVR_ATmega1280____AVR_ATmega2560____SAM3X8E__ARDUINO_SAMD_MKR1000_VARIANT_ARDUINO_ZERO__VARIANT_ARDUINO_101_X___AVR_AT90USB162__ARDUINO_LINUX__AVR_ATmega644P____AVR_ATmega644____AVR_ATmega645__- ... and many others
What we need to design is a symbolic that can be referenced within a sketch compiled for PiDuino that allows the compilation to know that it is being compiled for a PiDuino.
Here are some possibilities for consideration:
__PIDUINO____RASPBERRY_PI__
I would further suggest that we have a second variable that identifies the model of Raspberry Pi. Possibilities for consideration include:
__VARIANT_PI_A____VARIANT_PI_B____VARIANT_PI_A_PLUS____VARIANT_PI_B_PLUS____VARIANT_PI_2_B____VARIANT_PI_ZERO__
Once we choose and lock down some definitions, we can then approach some of the more popular packages and issue pull requests with the PiDuino definitions added.