Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TBSense2_Sensor_Demo mbed-BLE-coragem-teste Pulga_BLE_GPS pulga-mbed-lorawan-gps ... more
You are viewing an older revision! See the latest version
Homepage
Sample library for use with the Silicon Labs Si1133 sensor for visible light intensity (lux) and UV index measurements.
Datasheet¶
https://www.silabs.com/documents/public/data-sheets/Si1133.pdf
Usage¶
#include "mbed.h" #include "Si1133.h" //Create an Si1133 object Si1133 sensor(PC4, PC5); int main() { //Try to open the Si1133 if (sensor.open()) { printf("Device detected!\n"); while (1) { //Print the current light level printf("Lux = %.3f\n", (float)sensor.get_light_level()); //Print the current UV index printf("UV index = %.3f\n", (float)sensor.get_uv_index()); //Sleep for 0.5 seconds wait(0.5); } } else { error("Device not detected!\n"); } }