Advertisement
Chrismolloy

Chris today

Apr 5th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float f = 5.6789;
  2. char s[11];
  3.  
  4. void setup()
  5. {
  6.     Serial.begin(115200);
  7.     delay(1000);
  8.     dtostrf(f, 8, 2, s);
  9.     Serial.println("|" + (String)s + "|");
  10.  
  11. }
  12.  
  13.  
  14.  
  15. Integer to formatted string itoa()
  16. int i = 2147483647;  max int on avr processor
  17. char s[11];
  18.  
  19. void setup()
  20. {
  21.     Serial.begin(115200);
  22.     delay(1000);
  23.     itoa(i, s,10);
  24.     Serial.println("|" + (String)s + "|");
  25.  
  26. }
  27.  
  28. Serial.println multiple vars and strings
  29.  
  30. Serial.println("|" + (String)s + "|"); where s is a variable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement