digitalWrite(INB, LOW);
}
analogWrite(ENB, newspeed);
break;
case 'C': // Controlling Both Motors
if (dir == 'F') {
digitalWrite(INA, HIGH);
digitalWrite(INB, HIGH);
}
else if (dir == 'R') {
digitalWrite(INA, LOW);
digitalWrite(INB, LOW);
}
analogWrite(ENA, newspeed);
analogWrite(ENB, newspeed);
break;
}
// Send what we are doing with the motors out to the Serial Monitor.
Serial.print ("Motor: ");
if (mot=='C')
Serial.print ("Both");
else
Serial.print (mot);
Serial.print ("t Direction: ");
Serial.print (dir);
Serial.print ("t Speed: ");
Serial.print (speed);
Serial.print ("t Mapped Speed: ");
Serial.println (newspeed);
}
*CODE END
Need help?
Do you have a question about the Uno and is the answer not in the manual?
Questions and answers