Download Print this page

Arduino Uno Manual page 10

Motor driver shield
Hide thumbs Also See for Uno:

Advertisement

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

Advertisement

loading
Need help?

Need help?

Do you have a question about the Uno and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mega2650