This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

sprintf() for float in CCS5.3 for MSP430G2553

hi,

i try to use sprintf the float to string in ccs 5.3, but it doesn't work.

i set the breakpoint at the _nop(), and set the watchpoint for s. 

i  got s[10]={.,2,f,.,.,.,.,.,.,.,.} in string and s[10]={0x2E,0x32,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00}

in the properties,  the level of printf support required is set "full".

is there anything i need to be modify or careful?

#include <msp430.h>
#include <stdio.h>
#include <string.h>

float temperature = 12.34;
char s[10]={0};

void main(void)
{

  memset(s,0,sizeof(s));
  sprintf(s,"%6.2f",temperature);

  _nop();
}

**Attention** This is a public forum