![]() |
IoT Drivers
v3.3.0 (S2022)
Engineering in Software Technology
|
This is the quick start guide for the Driver for TSL2591 Light sensor, with step-by-step instructions on how to configure and use the driver in a selection of use cases.
The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.
The following must be added to the project:
Call back function
The driver needs a call back function to that it will call to tell the result of a function call.
An simple example of a call back function can be seen here:
Add to application initialization:
Initialise the driver by given it a function pointer to your call back function (in this example: tsl2591Callback):
In this use case, the steps to perform a measuring is shown.
The sensor must be powered up before it can be used. This is done with the following command:
The following must be added to the application code: