Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String Rui = "";
- //-----------------------
- void setup()
- {
- Serial.begin(9600);
- }
- //-----------------------
- void loop()
- {
- if (Serial.available())
- {
- char a = Serial.read();
- if (a != '%')
- {
- Rui += a;
- }
- else
- {
- int valorLedAnalogico = Rui.toInt();
- Serial.println(valorLedAnalogico);
- Rui = "" ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement