- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey guys,
I am new to TAG development. Since there aren't many examples relating I2C, can someone please post a simple code that read/write registers via I2C and displays it in the console window. Thanks in advance.
Solved! Go to Solution.
- Labels:
-
I2C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i2c_temperature_sensor.c has the simplest implementation, follow temperature_sensor_read_and_print_temperature_data() and it does exactly this - reads the current temperature from the sensor and then writes it out as a debug trace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello jjafer,
Please see the I2C example in the SDK 2.1.1
This example explains the I2C connection to a temperature sensor.
Please also see the WICED SENSE Kit BLOG - which shows a Video Walk-Thru of the I2C code used to talk to 5 sensors over I2C bus.
Hope this helps
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JT,
Thanks for the info. I went through the BLOG and watched the walk through video but the video did not talk about how the I2C was implemented and used. It just mentioned that I2C was used and the drivers to read through I2C for those particular sensors were provided by ST. I am looking for a simple code that reads a register through I2C and prints it to the console. Really appreciate your help.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i2c_temperature_sensor.c has the simplest implementation, follow temperature_sensor_read_and_print_temperature_data() and it does exactly this - reads the current temperature from the sensor and then writes it out as a debug trace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks arvinds, I will try this out.