Click here to Skip to main content
13,140,023 members (49,876 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Can PID control be added to control this algorithm? If so, how? Looking to incorporate but can't figure it out

#include <Servo.h>
Servo myservo;
int pos = 0;  
int inputPhotoLeft = 1; 
int inputPhotoRight = 0;
int Left = 0; 
int Right = 0; 
void loop()
Left = analogRead(inputPhotoLeft);
Right = analogRead(inputPhotoRight);
Posted 10-Jan-13 14:36pm
Updated 10-Jan-13 18:42pm
Christian Graus 10-Jan-13 20:45pm
What language is this ? What are you doing ?
Member 9747032 10-Jan-13 20:50pm
This is Arduino IDE language. I'm looking to add PID control to this algorithm for fun. The goal is for the servo to follow light based on the input values from photo resistors using PID control
Christian Graus 10-Jan-13 20:53pm
Interesting. Are there forums anywhere with users of this language ? I bet most people here have not heard of it.
Member 9747032 10-Jan-13 20:55pm
Sorry I forgot to add *C++ language
Christian Graus 10-Jan-13 20:57pm
OK - so tag your question C++ also

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The answer is yes of course it can.
One simple Google search "pid arduino" would have given you this pid library second in the list along with many other pid arduino references.[^]

Why don't you try this and get back with a specific question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100