I've tried numerous BH1750 programs I got off the web. None of them work. Usually the error is;
Arduino: 1.6.3 (Windows 7), Board: "Arduino Micro"
Build options changed, rebuilding all
BH1750_serial.ino:22:23: fatal error: BH1750FVI.h: No such file or directory
compilation terminated.
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
How do I add "BH1750FVI.h" file to my sketch?
Or are there downloads that have all the code I need in one sketch?
I've used Basic Stamp for years but I'm brand new at Arduino, so try not to get too technical.
Thanks!
BH1750FVI.h: No such file or directory
How is that library called out in your sketch? Post your code.
#include<BH1750FVI.h> put BH1750FVI.h in /Arduino/libraries/BH1750FVI folder?
#include"BH1750FVI.h" put BH1750FVI.h in same folder as your sketch, will appear as a tab in IDE when sketch is opened.
Might have to do some experimenting with folder & file placement.
I added the bh1750.h to libraries and the code works! But when I open the monitor it only
prints " 54612 lux" no mater what, even if i remove the light sensor. Any advice?
Thanks for your help.
Here's the Code
/*
Example of BH1750 library usage.
This example initalises the BH1750 object using the default
high resolution mode and then makes a light level reading every second.
Connection:
VCC-5v
GND-GND
SCL-SCL(analog pin 5)
SDA-SDA(analog pin 4)
ADD-NC or GND
*/
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
lightMeter.begin();
Serial.println("Running...");
}
void loop() {
uint16_t lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
No, show us the code that
prints " 54612 lux" no mater what
.
Use code tags, please.
Connection:
VCC-5v
GND-GND
SCL-SCL(analog pin 5)
SDA-SDA(analog pin 4)
ADD-NC or GND
According to the diagram I have for the "Arduino Micro", the I2C connections are not on analog pins 4 and 5.
Have you verified that you have any I2C working connection at all ?
michinyon, I didn't know the pin outs were different. What pins do I use? Whats an I2c connection?
How do I check this? I'm totally new with Arduino.
Thanks