本人本科新手,毕设要做这个题目,用的是M24LR-Discovery的开发板,有NFC功能,主芯片是STM8L152C6T6,它自带温度传感器,现在获取温度信息的代码如下,主要我想实现的是怎么把数据写进标签里?是写进flash还是eeprom中?我最后只需要手机APP能读出这个数据就行了!!求大神解答,需要在这中间加什么代码?
static void User_GetOneTemperature (uint8_t *data_sensor)
{
uint8_t Pointer_temperature = 0x00; /* temperature access */
data_sensor[0] = 0x00;
/* Config the Temperature sensor in OneShotMode */
I2C_SS_Init();
I2C_SS_Config(STTS751_STOP);
delayLFO_ms (1);
I2C_SS_Config(STTS751_ONESHOTMODE);
delayLFO_ms (1);
/* read 2 bytes temperature and store them into data_sensor[] */
I2C_SS_ReadOneByte(data_sensor,Pointer_temperature);
delayLFO_ms (1);
}
|