Hie, is there any way I can link an ultrasonic sensor with the Pluto X and build the X ranger projects?
If Yes, please let us know how we can connect the API for it or how we can create another simple program to run it.
Hi,
You can interface Ultrasonic sensors using Analog input APIs. However I would not recommend it, as ultrasonic sensors are pretty heavy for Pluto. You may still try it.
Hey, thank you for the reply.
Can you also help me out with the function to program the ultrasonic sensor on the Pluto?
It will be really great if you could share the complete program itself.
Which Ultrasonic sensor do you have ? assuming its HCSR04 , I can help you with code . I have used the same in micro python . The logic is as below .
code used in micropython
def get_distance():
pcf.pin(0,0)
utime.sleep_us(2)
pcf.pin(0,1)
utime.sleep_us(20)
while pcf.pin(0)==0:
pass
t1=utime.ticks_us()
while pcf.pin(0)==1:
pass
t2= utime.ticks_us()
cm= (t2-t1)/58.0
print(cm)
return cm
i will receive the my drone tomorrow then may be can help with Pluto blocks
Author
Posts
Viewing 3 reply threads
You must be logged in to reply to this topic.
Cart
What are you looking for?
Hi, I am Plubo, your co-pilot. How can I assist you today?