Go Down

Topic: Adafruit SI1145 UV Sensor (Read 121 times) previous topic - next topic


What do I do if this error code pops up?

Arduino: 1.8.2 (Windows Store (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\swagk\AppData\Local\Temp\Temp1_Adafruit_SI1145_Library-master.zip\Adafruit_SI1145_Library-master\examples\si1145test\si1145test.ino:19:29: fatal error: Adafruit_SI1145.h: No such file or directory

 #include "Adafruit_SI1145.h"


compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Install the SI1145 library, probably.


I already have it installed.


I have another problem. It says that 'uv' was not declared in the scope.
This is the code.


For use with the Adafruit Si1145 UV visible light Sensor.

void setup() {
  Serial.println("Adafruit SI1145 test");
  if (! uv.begin()) {
    Serial.println("Didn't find Si1145");
    while (1);


void loop() {
  Serial.print("Vis: "); Serial.println(uv.readVisible());
  Serial.print("IR: "); Serial.println(uv.readIR());
  // Uncomment if you have an IR LED attached to LED pin!
  //Serial.print("Prox: "); Serial.println(uv.readProx());

  float UVindex = uv.readUV();
  // the index is multiplied by 100 so to get the
  // integer index, divide by 100!
  UVindex /= 100.0; 
  Serial.print("UV: ");  Serial.println(UVindex);



Apr 29, 2017, 10:23 pm Last Edit: Apr 29, 2017, 10:28 pm by PaulRB
You lost the first few lines of the sketch. Please put them in and put in code tags like the form rules say to!

Before you say "that is all the code", no it isn't, and that's why you are getting the error. Did you just delete out the line that gave the previous error? That won't work.

Go Up