tsl2561 tsl4531 update
This commit is contained in:
parent
92b18cf2fd
commit
84af4e4bb1
6 changed files with 51 additions and 47 deletions
|
|
@ -16,6 +16,7 @@
|
|||
* Connect 3.3v from the ESP to Vin and GND to GND
|
||||
*/
|
||||
|
||||
#define I2C_BUS (0)
|
||||
#define SCL_PIN (2)
|
||||
#define SDA_PIN (0)
|
||||
|
||||
|
|
@ -27,7 +28,8 @@ void tsl2561MeasurementTask(void *pvParameters)
|
|||
// TSL2561_I2C_ADDR_VCC (0x49)
|
||||
// TSL2561_I2C_ADDR_GND (0x29)
|
||||
// TSL2561_I2C_ADDR_FLOAT (0x39) Default
|
||||
lightSensor.i2c_addr = TSL2561_I2C_ADDR_FLOAT;
|
||||
lightSensor.i2c_dev.bus = I2C_BUS;
|
||||
lightSensor.i2c_dev.addr = TSL2561_I2C_ADDR_FLOAT;
|
||||
|
||||
tsl2561_init(&lightSensor);
|
||||
|
||||
|
|
@ -63,7 +65,7 @@ void tsl2561MeasurementTask(void *pvParameters)
|
|||
void user_init(void)
|
||||
{
|
||||
uart_set_baud(0, 115200);
|
||||
i2c_init(SCL_PIN, SDA_PIN);
|
||||
i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K);
|
||||
|
||||
xTaskCreate(tsl2561MeasurementTask, "tsl2561MeasurementTask", 256, NULL, 2, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue