Skip to content

janjongboom/mbed-tsl2572

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

TSL2572 Mbed OS driver

Mbed OS 5 driver for the TSL2572 Ambient Light Sensor.

Usage

#include "TSL2572Sensor.h"

static TSL2572Sensor tsl2572(I2C_SDA, I2C_SCL);

int main() {
    // make sure to check the return values (should be 0)
    tsl2572.init();
    tsl2572.enable();

    uint8_t id;
    tsl2572.read_id(&id);
    printf("TSL2572 light intensity ID = 0x%X\r\n", id);

    float lux;
    tsl2572.read_ambient_light(&lux);
    printf("TSL2572: [lght] %.2f lux\r\n", lux);
}

About

Mbed OS driver for the TSL2572 ambient light sensor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages