DFRobot ROB0118 Manual - Página 11

Procurar online ou descarregar pdf Manual para Robótica DFRobot ROB0118. DFRobot ROB0118 13 páginas.

//
}
//
carBack(150,150);
}
void SensorSetup(){
pinMode(URTRIG,OUTPUT);
digitalWrite(URTRIG,HIGH);
pinMode(URPWM, INPUT);
and
for(int i=0;i<4;i++){
Serial.write(EnPwmCmd[i]);
}
}
int MeasureDistance(){
eading
digitalWrite(URTRIG, LOW);
digitalWrite(URTRIG, HIGH);
pulses
unsigned long distance=pulseIn(URPWM,LOW);
if(distance==50000){
Serial.print("Invalid");
}else{
distance=distance/50;
}
return distance;
}
void carStop(){
digitalWrite(speedPin_M2,0);
digitalWrite(directionPin_M1,LOW);
carAdvance(70,70);
Serial.println("carAdvance");
delay(100);
// a low pull on pin COMP/TRIG
//
// A low pull on pin COMP/TRIG
// Set to HIGH
// Sending Enable PWM mode comm
// reading Pin PWM will output
// the reading is invalid.
// every 50us low level stands for 1cm
Motor Stop
triggering a sensor r