hello,
i want to try it here, in the english forum, becouse i dont can find much informations about this sensor.
my english is not so good, but i will try it.
i want to use the bh1720 with 0,11lx and 100000lx (on an attiny).
with this libary it works:
Umgebungslichtsensor BH1750 - is in german !
GitHub - hexenmeister/AS_BH1750: a (Arduino) library for the BH1750FVI Digital Light Sensor
but the libary dont work good on an attiny with tinywireM.
and i like to use it without the libary.
but i dont understand the datasheet.......
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
what have i to do for 0,11lx and 100000lx ?
i have this:
#include "TinyWireM.h"
#include <SoftwareSerial.h>
SoftwareSerial softSerial(88, 3 ); //rx= physikalisch Pin 3(attiny85) Pin 11?(attiny84), tx= physikalisch Pin 2(attiny85) Pin 10(attiny84)
byte buff[2];
int Adresse = 0x23;
float Lux = 0.00;
void setup()
{
TinyWireM.begin();
softSerial.begin(9600);
}
void loop()
{
// Check I2C Adresse
TinyWireM.beginTransmission(Adresse);
if(TinyWireM.endTransmission()!=0)
{
softSerial.println("falsche i2c adresse");
}
TinyWireM.beginTransmission(Adresse);
TinyWireM.send(0x21); // 0,5 lux aufloesung + Power down
TinyWireM.endTransmission();
byte i=0;
TinyWireM.requestFrom(Adresse, 2);
while(TinyWireM.available())
{
buff[i] = TinyWireM.receive();
i++;
}
Lux = ((buff[0]<<8)|buff[1])/1.2;
if(Lux < 0)
{
softSerial.println("> 65535");
}
else
{
softSerial.print(Lux); softSerial.println(" lx");
}
delay(1000);
}
but its only to 65535lx
thank you very much