Anonymous
Not applicable
Jul 30, 2014
08:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 30, 2014
08:11 AM
Anyone have any example code for interfacing a 5LP to an Analog Devices ADXL3xx accelerometer using i2c?
Im interested in the best way of implementing the write/read operations in which you write a register number and read the content.
Labels
- Labels:
-
PSoC 5LP
2 Replies
Jul 30, 2014
09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 30, 2014
09:15 AM
I used a different accellerometer with I2C and it resulted in the sequence of
I2C_SendStart()
I2C_WriteByte()
I2C_SendRestart()
I2C_ReadByte(NAK)
My device allowed for multiple reads which were done with I2C_ReadByte(ACK) while only the last byte was red with a NAK.
Never forget to analyze a returned state for error conditions.
Bob
Jul 30, 2014
09:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 30, 2014
09:16 AM
Oh, yes, and of course a I2C_SendStop().
Bob