DFRobot ROB0117 Manual de início rápido - Página 13
Procurar online ou descarregar pdf Manual de início rápido para Microcontroladores DFRobot ROB0117. DFRobot ROB0117 13 páginas. Basic kit for cherokey 4wd
2015/11/4
}
void carTurnLeft(int leftSpeed,int rightSpeed){
analogWrite (speedPin_M2,leftSpeed);
digitalWrite(directionPin_M1,LOW);
analogWrite (speedPin_M1,rightSpeed);
digitalWrite(directionPin_M2,HIGH);
}
void carTurnRight(int leftSpeed,int rightSpeed){
analogWrite (speedPin_M2,leftSpeed);
digitalWrite(directionPin_M1,HIGH);
analogWrite (speedPin_M1,rightSpeed);
digitalWrite(directionPin_M2,LOW);
}
void servoSweep(){
if(sweepFlag){
if(pos>=60 && pos<=120){
pos=pos+1;
myservo.write(pos);
}
if(pos>119) sweepFlag = false;
}
else {
if(pos>=60 && pos<=120){
pos=pos-1;
myservo.write(pos);
}
if(pos<61) sweepFlag = true;
}
}
Your own car was born!
Retrieved from "https://www.dfrobot.com/wiki/index.php?
title=Basic_Kit_for_Cherokey_4WD_SKU:ROB0117&oldid=28238"
This page was last modified on 10 February 2015, at 06:02.
This page has been accessed 1,633 times.
https://www.dfrobot.com/wiki/index.php?title=Basic_Kit_for_Cherokey_4WD_SKU:ROB0117
Basic Kit for Cherokey 4WD SKU:ROB0117 - Robot Wiki
//Turn Left
//Turn Right
// in steps of 1 degree
// tell servo to go to position in variable 'pos'
// assign the variable again
13/13