DFRobot ROB0118 매뉴얼 - 페이지 8

{카테고리_이름} DFRobot ROB0118에 대한 매뉴얼을 온라인으로 검색하거나 PDF를 다운로드하세요. DFRobot ROB0118 13 페이지.

}
}
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(){
nsor reading
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 servoSweep(){
if(sweepFlag ){
if(pos>=60 && pos<=120){
pos=pos+1;
myservo.write(pos);
sition in variable 'pos'
}
// A low pull on pin COMP/TRIG
// Set to HIGH
// Sending Enable PWM mode comm
// a low pull on pin COMP/TRIG
// reading Pin PWM will output
// the reading is invalid.
// every 50us low level stands for 1cm
triggering a se
// in steps of 1 degree
// tell servo to go to po