Proximity sensor code

Hello everyone. New to the forum so I apologise for anything I say that is incorrect.

Right now I’m using the HR-SC04 ultrasound sensor (the one with 2 big round sensors and the code works perfect for me but I want to use a much smaller sensor like the Sharp Digital Sensor or something equivalent. Unfortunately I don’t have any code that will work on a sharp sensor and I am terrible at coding. What I need is a servo motor to rotate 90* when the sensor detects an object about 3 to 5cm away and hold the position for 3 to 5 seconds and then return to its original servo position. It’s opening a tiny gate on my Christmas village. Can anyone help?

if you don't want to learn, this seems a great ask for the Jobs and Paid Consultancy forum, make sure you mention your budget.

you could also search the internet for ideas, for example for the Pololu Distance Sensor with Pulse Width 50cm

Wonderful. Thank you :pray:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.