RuiViana

Str_To_Int e Int_to_Str

Nov 15th, 2016
137
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String MinhaStr = "1234";
  2. int MeuInt = 1678;
  3. String NovaStr ;
  4. int NovoInt;
  5. //-----------------
  6. void setup()
  7. {
  8.   Serial.begin(9600);
  9. }
  10. //-----------------------
  11. void loop()
  12. {
  13.  NovoInt = (MinhaStr.toInt());   // String para int
  14.  Serial.print(NovoInt);
  15.  NovaStr = String(MeuInt);     // Int para String
  16.  Serial.print( NovaStr);
  17. }
RAW Paste Data