Adafruit SI1145 UV Sensor

Hi,
Has anyone got some example code using the AdaFruit SI1145 sensor.
I have downloaded their library, but had to make a few changes (boolean - bool, etc).
I can get it to compile, but using their sample, my Photon goes in to SOS mode

sample…

setup contains…
Adafruit_SI1145 uv = Adafruit_SI1145();

loop contains a call to
Serial.print("Vis: "); Serial.println(uv.readVisible());

which causes the crash.

any assistance would be great.

thanks

If you want us to have a look at something providing a link would save us the need and possible frustration to search for it.

BTW: bool and boolean should both work.
Also, when stating SOS conditions it would be helpful to state how many flashes you see between two SOSs.

The only thing I had to alter in that lib to have it build was to replace the whole include block from the header file with #include "Particle.h".
Just for convenience also change this in setup()

   while (1) Particle.process(); // to keep cloud connection in tact

More testing is not possible without the hardware :wink:

Hi There,
Thanks for the reply and advise.

Well I tested my hardware against an Arduino and it worked, so then looked back at my code, and turns out somehow I had removed the important line:
uv.begin();

from setup - Doh!

So I can confirm the Adafruit library works perfectly as is, and their SI1145Test program also work as is.

I’m now of to an ‘attention to detail’ evening class !

2 Likes