MBED: read TMP102 temp using ble nano


#1

Hi
I am trying to read temp from TMP102 sensor using BLE NANO. The sensor works well when used with arduino pro mini and arduino scketch (i2c)

However, when I import TMP102 library program sample into MBED env in order to use ble nano it does not works.

Need help… Thank you

Alex
Sample program

#include “mbed.h”
#include “TMP102.h”
TMP102 temperature(P0_10, P0_8, 0x90); //ADD0 pin is connected to ground
int main()
{
while(1)
{
printf(“Temperature: %f\n”, temperature.read());
wait(1.0);
}
}

Output:
Temperature: 0.000000
Temperature: 0.000000
Temperature: 0.000000
Temperature: 0.000000
Temperature: 0.000000


#2

Hi,

Not sure if this helps or not for you.

https://os.mbed.com/users/nemovn/notebook/assigning-i2c-pins-manually-/