2023-04-22 07:21 PM - edited 2023-11-20 07:24 AM
I have programmed the temperature sensor, but it seems that it has not been successful, the NDEF reading result is shown in the figure, what should I do?
if( NfcType5_NDEFDetection( ) != NDEF_OK )
{
CCFileStruct.MagicNumber = NFCT5_MAGICNUMBER_E1_CCFILE;
CCFileStruct.Version = NFCT5_VERSION_V1_0;
CCFileStruct.MemorySize = ( ST25DVXXKC_MAX_SIZE / 8 ) & 0xFF;
CCFileStruct.TT5Tag = 0x05;
/* Init of the Type Tag 5 component (M24LR) */
while( NfcType5_TT5Init( ) != NFCTAG_OK );
}
/* Init done */
NFC07A1_LED_Off( GREEN_LED );
HAL_Delay( 300 );
NFC07A1_LED_Off( BLUE_LED );
HAL_Delay( 300 );
NFC07A1_LED_Off( YELLOW_LED );
HAL_Delay( 300 );
/* write text message to EEPROM */
K_Temperature= MAX6675_ReadTemperature(); //读�?�热电�?�温度值
HAL_Delay(1000);
// 将浮点数转�?�为字符串
char temp_str[20];
sprintf(temp_str, "%f", K_Temperature);
// 将字符串转�?�为无符�?�8�?整数数组
uint8_t temp_data[strlen(temp_str)];
memcpy(temp_data, temp_str, strlen(temp_str));
// 写入NDEF消�?�
NDEF_WriteNDEF(strlen(temp_str), temp_data);
//读�?�NDEF消�?�
NDEF_ReadNDEF(temp_data);
/* Set the LED3 on to indicate Programing done */
NFC07A1_LED_On( YELLOW_LED );
}
Solved! Go to Solution.
2023-04-26 04:53 AM
Hi,@Brian TIDAL_O
I also think I have a problem. I don't know what's wrong with the data,and I'm sure there is no problem with the data of the MAX6675, it may be that there is a discrepancy in the conversion, please check it for me.
2023-04-26 05:20 AM
Hi,
This a community for ST products and as far as I know MAX6675 is not an ST product. Therefore I would suggest you contact the manufacturer of this device for proper support on this device. I believe that the initial NDEF issue reported in your post is now solved and can be closed.
Rgds
BT
2023-04-26 05:23 AM
Hi,@Brian TIDAL_O
OK. Are you sure the code I mentioned is correct about the use of NDEF related functions? Is the temperature data correctly written to memory?
2023-04-26 05:27 AM
Hi,
as already explained in a previous post:
when the NDEF TEXT message is properly formatted, Android displays the text (i.e. decodes the NDEF and extracts the payload). If using the ST25 NFC Tap app, the NDEF tab display "Text record"; the content of the record is displayed when pressing on the "Text record" field.
This is the way you should check.
Rgds
BT