tedyapo / arduino-VEML7700

Arduino driver for VEML7700 ambient light sensor
MIT License
3 stars 6 forks source link

ESP32 i2c/wire issue #7

Open asetyde opened 6 years ago

asetyde commented 6 years ago

https://github.com/espressif/arduino-esp32/issues/1657

asetyde commented 6 years ago

To work with ESP32 Library change this part, on file .ccp line 58

uint8_t VEML7700:: receiveData(uint8_t command, uint16_t& data) { Wire.beginTransmission(I2C_ADDRESS); if (Wire.write(command) != 1){ return STATUS_ERROR; } if (Wire.endTransmission(false) != 7 ){ // NB: don't send stop here return STATUS_ERROR; } if (Wire.requestFrom(uint8_t(I2C_ADDRESS), uint8_t(2)) != 2){ return STATUS_ERROR; } data = Wire.read(); data |= uint16_t(Wire.read()) << 8; return STATUS_OK; }

tedyapo commented 6 years ago

This needs to conditionally compiled in, since it's an issue specific to ESP32 I2C. Having just the "!=7" breaks it on the other boards. I'll consider changing it to work around the broken ESP32 hardware, but I don't have the cycles to do it immediately.

asetyde commented 5 years ago

Hi , i risolve bug on freezer i2c , ALSAutoLux with algoritmo code has a strange bug , using AUtolux without it no issue