Programatically determine device

Is it possible to determine what device a project is compiled for using #defines?
I have a project that I want to do slightly different things depending on if it’s running on a Photon vs an Electron.

Yes. You can check the PLATFORM_ID for Photon (6) or Electron (10). However, there are also a set of defines for specific features like whether the device has WiFi or Cellular that are better to use in many cases.

You don’t need to include anything special to use the Wiring_* defines, they’re included from Particle.h and automatically for .ino files.


That’s exactly what I need, thanks!