cancel
Showing results for 
Search instead for 
Did you mean: 

temperature sensor NDEF

Schuyler
Senior

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 );

}


_legacyfs_online_stmicro_images_0693W00000bidNeQAI.png

13 REPLIES 13
Schuyler
Senior

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.

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Schuyler
Senior

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?

Brian TIDAL
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.