- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Can anyone help me with the code to read sensor data from TSL2591 light sensor using I2C communication.
Any suggestion in this direction would be helpful.
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use an I2C component as master and address your slave as 0x29 as shown in the TSL2591 datasheet.
Initialize the device by writing into the appropriate registers.
Typical sequence for reading from I2C is
Sendstart() to initialize a transmission
WriteByte() to indicate which internal register to read
SendRestart() now indicate reading
ReadByte() The last byte read must be NAKed to tell slave that transfer is done
SendStop() to telease the bus
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use an I2C component as master and address your slave as 0x29 as shown in the TSL2591 datasheet.
Initialize the device by writing into the appropriate registers.
Typical sequence for reading from I2C is
Sendstart() to initialize a transmission
WriteByte() to indicate which internal register to read
SendRestart() now indicate reading
ReadByte() The last byte read must be NAKed to tell slave that transfer is done
SendStop() to telease the bus
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob 🙂