Skip to content

Commit

Permalink
Added float example to StringConstructor
Browse files Browse the repository at this point in the history
This example has been added according to arduino#3264
  • Loading branch information
agdl committed Jun 1, 2015
1 parent a9cdd44 commit c28fb7a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ void loop() {
// prints "123456" or whatever the value of millis() is:
Serial.println(stringOne);

//using a float and the right decimal places:
stringOne = String(5.698, 3);
Serial.println(stringOne);

//using a float and less decimal places to use rounding:
stringOne = String(5.698, 2);
Serial.println(stringOne);

// do nothing while true:
while (true);

Expand Down

0 comments on commit c28fb7a

Please sign in to comment.