AM2315 compile error on electron

Does the Adafruit_AM2315 library not work with the Electron? It seems to be having a problem with Wire. This is the error I am getting:

Adafruit_AM2315/Adafruit_AM2315.cpp: In member function 'bool Adafruit_AM2315::begin()':

Adafruit_AM2315/Adafruit_AM2315.cpp:35:3: error: 'Wire' was not declared in this scope

The library needs some updating to get it working with electron. It’s just a conditional that the library porter has written.

If you want to use it, you can copy the content from .h and .cpp and make the change in the .cpp file by removing

#if (PLATFORM_ID == 6)
  #define PHOTON

#ifdef PHOTON
  #include "application.h"

and change to

  #include "application.h"

I will send in the fix to the library repo later :slight_smile:

UPDATE - Sent in a fix here:

1 Like