Papelero
Papelero
Papelero
h>
int inches = 0;
int cm = 0;
long readUltrasonicDistance(int
triggerPin, int echoPin)
pinMode(triggerPin, OUTPUT);
// Clear the trigger
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
Servo servo_6;
void setup()
void loop()
if (0.01723 *
readUltrasonicDistance(13, 12)
<= 50) {
servo_6.write(70);
} else {
servo_6.write(0);