You might try:
if(Serial.available())
{
n = Serial.read();
if(n == 's')
spd = Serial.parseInt();
Then you could enter "s200" [ENTER] in serial monitor. Use h (halt) for stop.
You might try:
if(Serial.available())
{
n = Serial.read();
if(n == 's')
spd = Serial.parseInt();
Then you could enter "s200" [ENTER] in serial monitor. Use h (halt) for stop.