PID control with CCS C

hello all members;

im trying to fast line follower robot with PID ,but i cant do this ,im using pic 16f877a with adc, give some sample code
plz

Hello.

en.wikipedia.org/wiki/PID_controller#Pseudocode

- Ben

hello thanks for posting ,I’ve seen this place before however I looked at all the forums,but i cant write i need to source code for ccs c

You’re not likely to get very far asking someone to write your code for you, especially given that what you have asked is not possible without additional information. In your case, the PID algorithm is a way to map sensor input to a motor output. How is someone supposed to write that for you based on the information you have provided? You might as well have asked: “I have a PIC. I need to make a robot. Give me code.”

Just some friendly advice: people are a lot more likely to help you if you ask something like “can you help me figure this out” than if you ask “please do my homework for me”.

- Ben

sensor(QTR-8A) is connected to A port(an0,an1,an2,an3,an4,an5,an6,an7),I am using the tb6612fng motor driver ,tb6612fng is connected to B port … (16F877a)

I suggest that you post on the CCS C forum
ccsinfo.com/forum/

why? Does not anyone using ccs c in this forum?

I use both AVR and PIC microprocessors and for the latter, I use MPLAB for assembly-language programming and CCS C for higher level applications. However, I (and, I think the majority of amateur roboticists) prefer the free and excellent development systems available for AVR processors. In addition AVR processors seem to have more power for the price.

CCS C is expensive, very quirky and, partly because of the many unusual assumptions it makes regarding variable types, sometimes difficult to make do what you want. PIC processors are also quirky, with weird addressing modes. For these reasons it is difficult to adapt gcc programs intended for AVR processors to work on PICs.

If you want to take advantage of a huge base of free software for robotics experimentation, switch to AVR products and gcc-based development systems.