Go Down

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

CodingJZ088

What do I do if this error code pops up?




Arduino: 1.8.2 (Windows Store 1.8.3.0) (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.

nyphot

Install the SI1145 library, probably.


CodingJZ088

I already have it installed.

CodingJZ088

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.begin(9600);
 
  Serial.println("Adafruit SI1145 test");
 
  if (! uv.begin()) {
    Serial.println("Didn't find Si1145");
    while (1);
  }

  Serial.println("OK!");
}

void loop() {
  Serial.println("===================");
  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);

  delay(1000);
}
 

PaulRB

#4
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