I am using SRF04 in a sonar application.
I need the range to be displayed on an LED bargraph - LM3914 prefrably.
I have the SRF04 echo captured through the CCP module, which results in a 16-bit value.
How do I scale the 16-bit value into a 4-bit representation to present to the VRef module to give me a voltage level proportional to the SRF04 echo signal length.
I'm sure there's a imple solution, but my mind has gone blank over this, and what little hair I have left is steadily being pulled out!
Any ideas?
I need the range to be displayed on an LED bargraph - LM3914 prefrably.
I have the SRF04 echo captured through the CCP module, which results in a 16-bit value.
How do I scale the 16-bit value into a 4-bit representation to present to the VRef module to give me a voltage level proportional to the SRF04 echo signal length.
I'm sure there's a imple solution, but my mind has gone blank over this, and what little hair I have left is steadily being pulled out!
Any ideas?