1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Added float example to StringConstructor

This example has been added according to #3264
This commit is contained in:
Arturo Guadalupi
2015-06-01 09:48:28 +02:00
parent a9cdd44d27
commit c28fb7acd4

View File

@ -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);