Closed ramimehyar closed 2 years ago
Hi Rami,
That's a basic ASCII decimal decoder for testing over the console. It would for example decode the input sequence of '1' '2 '3' [enter] into the integer value of 123 and call setNextPosition(123).
Oh! I should have known this!
So it is similar to the function Serial.parseInt()
Thanks!
Hello Guy,
Can you please please explain to me the variables you are assigning to the character c...
I understand your driver pretty well, but i do not understand the example part:
if (Serial.available()) { char c = Serial.read(); if (c==10 || c==13) { motor1.setPosition(nextPos); nextPos = 0; } else if (c>='0' && c<='9') { nextPos = 10*nextPos + (c-'0');
Regards,
Rami