Rebel II

Source code

How would you use the ultrasonic sensor to make two motors stop and turn when an object is within a foot using a PIC16F84A

get reading from the sensor

get reading from the sensor when your hand is 12 inches away. Write down the reading given from the sensor

Pseudo Code:
get reading from srf05
If reading is < reading when 12 inches away
stop motors
else

keep going forward
endif