I2C Temperature Read
Introduction
This example demonstrates probing of sensor via I2C and read data from it. The application reads data from the temperature sensor in the EVM. Application reads 20 samples from the sensor and exits.
Supported Combinations
Parameter |
Value |
|---|---|
CPU + OS |
a53ss0-0 nortos |
CPU + OS |
a53ss0-0 freertos |
CPU + OS |
c75ss0-0 freertos |
CPU + OS |
mcu-r5fss0-0 nortos |
CPU + OS |
mcu-r5fss0-0 freertos |
Toolchain |
ti-arm-clang |
Toolchain |
arm.gnu.aarch64-none |
Toolchain |
ti-c7000 |
Boards |
am62dx-evm |
Example folder |
examples/drivers/i2c/i2c_temperature |
Steps to Run the Example
When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
See Also
Sample Output
Shown below is a sample output when the application is run,
[I2C] Temperature sensor found at device address 0x48
[I2C] Sample 0: 39.000000 (celcius)
[I2C] Sample 1: 39.000000 (celcius)
[I2C] Sample 2: 39.000000 (celcius)
[I2C] Sample 3: 39.000000 (celcius)
[I2C] Sample 4: 39.000000 (celcius)
[I2C] Sample 5: 39.000000 (celcius)
[I2C] Sample 6: 39.000000 (celcius)
[I2C] Sample 7: 39.000000 (celcius)
[I2C] Sample 8: 39.000000 (celcius)
[I2C] Sample 9: 39.000000 (celcius)
[I2C] Sample 10: 39.000000 (celcius)
[I2C] Sample 11: 39.000000 (celcius)
[I2C] Sample 12: 39.000000 (celcius)
[I2C] Sample 13: 39.000000 (celcius)
[I2C] Sample 14: 39.000000 (celcius)
[I2C] Sample 15: 39.000000 (celcius)
[I2C] Sample 16: 39.000000 (celcius)
[I2C] Sample 17: 39.000000 (celcius)
[I2C] Sample 18: 39.000000 (celcius)
[I2C] Sample 19: 39.000000 (celcius)
All tests have passed!!