Making a generic project allows a maximum of people to reproduce it. That's why I tried to make it compatible with all kind of controllers, even the less powerful ones.
But I also use some specificities, only present on some controllers to bring more functionality to my project (USB-HID on Teensy, Wifi or Secure Element on MKR 1010).
To manage several boards in his Arduino project without having compilation problems, I used lines like this
#ifdef ARDUINO_SAMD_MKRWIFI1010
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>
#endif
This will allow to include this library, only if I compile with a MKR 1010 target.
To manage features like USB HID, I now use this kind of code :
#ifdef USB_SERIAL
Serial.println("PASSWORD");
#endif
#ifdef USB_HID
Keyboard.print("PASSWORD");
#endif
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.