Jump to content
jcR

String conversion problem

Recommended Posts

on MSP430G2553 mounted on  launchpad

 

I have a problem with converting an integer to a String:

  uint8_t x=10;
  uint8_t y=10;
  String xx =  String(x,DEC); 
  String yy =  String(y,DEC); 
  Serial.println (xx);
  Serial.println (yy);
 
with Energia Vers 0101E0012 the result is 10 for xx and 10 for yy
 
but i will to use Energia  V17 to  use LMP4 mode .
the result is garbage for the two converted value --> xxx (three characters) then CR then xxx(garbage three characters)
 
the other problem with Energia V 18 , i can not reprogram the chip (on Windows 9) error is : unable to find a device matching 0451:f432
 
The first problem is very strange for me. 
Is what someone can check.
Thanks in advance

Share this post


Link to post
Share on other sites

I see similar behavior.  If I run the following sketch:

void setup(){
  Serial.begin(9600);
  int8_t x=10;
  uint8_t y=10;
  int a = 10;
  unsigned int b = 10;
  char c = 10;
  unsigned char d = 10;
  long e = 10;
  unsigned long f = 10;
  String xx =  String(x,DEC);
  String yy =  String(y,DEC);
  String aa =  String(a,DEC);
  String bb =  String(b,DEC);
  String cc =  String(c,DEC);
  String dd =  String(d,DEC);
  String ee =  String(e,DEC);
  String ff =  String(f,DEC);  
  Serial.println (xx);
  Serial.println (yy);
  Serial.println (aa);
  Serial.println (bb);
  Serial.println (cc);
  Serial.println (dd);
  Serial.println (ee);
  Serial.println (ff);
}

void loop(){
}

I get the following output:

10

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...