ToF 10120 with relay cut off

Good day everyone.
I am new to coding and i am struggling with my code at the moment i am completely stuck.
I am using a arduino mega with a TOF 10120 and a relay.
I want to use the TOF10120 to measure distance and have a minimum distance cut off to avoid opsticals.
As soon as it reaches say 120mm it must trigger the relay to the for either warming light or cut the power completely to the drive motor.
You help would be highly appreciated and might also save an arduino board in the process.

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