Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long valor;
- void setup()
- {
- Serial.begin(9600);
- Serial.println(" Digite um valor : "); // Debug
- }
- void loop()
- {
- String saida = "";
- if (Serial.available() > 0)
- {
- valor = Serial.parseInt();
- }
- String minhaStr = (String)valor;
- int meuLgh = minhaStr.length();
- for ( int i = 0; i < 5 - meuLgh; i++)
- {
- saida += "0";
- }
- saida += minhaStr;
- Serial.println(saida);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement