We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I modify the sketch? The cytron has a PWM pin and a direction pin. I am also using a cytron library.
I changed the clockwise and counterclockwise functions as follows:
void MotorClockwise(int power){ if(power > 100){ // analogWrite(7, power); // digitalWrite(4, LOW); motor.setSpeed(128); // Run forward at 50% speed. }else{motor.setSpeed(0); // Stop // digitalWrite(4, LOW); // digitalWrite(7, LOW);
} }
void MotorCounterClockwise(int power){ if(power > 100){ // analogWrite(7, power); // digitalWrite(4, HIGH); motor.setSpeed(-128); // Run backward at 50% speed. }else{ // digitalWrite(4, LOW); // digitalWrite(7, LOW); motor.setSpeed(0); // Stop } }
It doesn't work -- the motor keeps going and going.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How do I modify the sketch? The cytron has a PWM pin and a direction pin. I am also using a cytron library.
I changed the clockwise and counterclockwise functions as follows:
void MotorClockwise(int power){
if(power > 100){
// analogWrite(7, power);
// digitalWrite(4, LOW);
motor.setSpeed(128); // Run forward at 50% speed.
}else{motor.setSpeed(0); // Stop
// digitalWrite(4, LOW);
// digitalWrite(7, LOW);
}
}
void MotorCounterClockwise(int power){
if(power > 100){
// analogWrite(7, power);
// digitalWrite(4, HIGH);
motor.setSpeed(-128); // Run backward at 50% speed.
}else{
// digitalWrite(4, LOW);
// digitalWrite(7, LOW);
motor.setSpeed(0); // Stop
}
}
It doesn't work -- the motor keeps going and going.
The text was updated successfully, but these errors were encountered: