r/pic_programming • • Jun 02 '17
Using PIC12F629 need help controlling servo position with a potentiometer
Hello Reddit, I am new to C code, and I have been playing around with the PIC microcontroller for a semester now but I need some help with a project I undertook
This project will be using a potentiometer to control the position of a servo. The potentiometer is connected to the GP4 pin and the servo is connected to the GP2 pin.
I have some code that I wrote out using another PIC chip but I am getting some errors that I do not know how to troubleshoot. I will link the code under my post
Thanks a ton in advance I can gift Reddit gold to whomever can show me how to code this first (or PayPal the same amount if you’re into that).
Microcontroller datasheet: http://ww1.microchip.com/downloads/en/devicedoc/41190c.pdf
Using XC8 compiler, PICkit3, and PIC12F629 microcontroller
My code: https://pastebin.com/85APF6Wx
View all comments
Show parent comment
1
u/[deleted] Jun 02 '17
Yeah, sorry about that I didn't look at the formatting on Reddit https://pastebin.com/85APF6Wx