Arduino Code : Board management

A project log for Gesture/Pattern Recognition Without Camera : TOF !

Grumpy Hedgehog is a connected device that allows you to read and interact with movements. Its LCD screen displays the Hedgehog's expression

jeanperardeljean.perardel 11/07/2021 at 22:160 Comments

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 

  #include <WiFiNINA.h>
  #include <BlynkSimpleWiFiNINA.h>

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
  #ifdef USB_HID