vincentspm
Newbie level 6

anyone who know how to design a circuit and program code for angle measurement using PIC16F877A and output to LCD display.
the similar product pic as i attach.
the similar product pic as i attach.
I use code as below to detect the voltage first on convert to angle, can make correction for me, why cannot get the voltage value display on LCD? did my calculation convert to voltage wrong?Old Nick said:Use a high quality linear pot as the hinge, connect as a voltage divider. The voltage in the middle of the divider vill vary linearly with angle. Use the pic to measure the voltage, convert to an angle and then send to a 7 segment display or similar.
ByteToStr(number, bytestring)
WordToStr(number, wordstring)
LCD_OUT(1,1,bytestring)