Hi, Im new to the arduino world, and I need some help... Im making a new project, I want to read distance from an IR sensor and change the focus of a liquid lens that maches the distance. I am using arduino nano v3.1. I connected it to a sharp 2y0a21 IR sensor to read distance from an object so far everything works fine, I connected it to a liquid lens driver (HV892) and used a i2c scanner library to read its address (0x23). I dont know how to write the code that maches every cm I read from the sensor to every voltage I want to send to the driver of the liquid lens.
Tnx in advance,