Convert the interesting values of distance_cm (whatever they are) into an angle suitable for writing to the servo (0-180). Then just write that to the servo. The map() function will probably help.
Steve
Convert the interesting values of distance_cm (whatever they are) into an angle suitable for writing to the servo (0-180). Then just write that to the servo. The map() function will probably help.
Steve