Go Down

Topic: line follow code (Read 1 time) previous topic - next topic

console

can someone please help me with my line following code, i am using x3 photodiodes and x3 IR with two servo motors. in desperate need for help please

JimboZA

For a start post a diagram of how you have it all hooked up, then paste the code you have so far....

Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

console

this is what ive started with. i know its easier to use if statements for when the diodes detect the black tape against the white background but im not sure how to actually write it.

#include <Servo.h>

Servo servoLeft;         
Servo servoRight;
int pd0 = 1;
int pd1 = 0;
int pd2 = 2;


void setup() {
  servoLeft.attach(10); 
  servoRight.attach(9);
  pinMode(pd0, INPUT);
  pinMode(pd1, INPUT);
  pinMode(pd2, INPUT);
  Serial.begin(9600);
}

AWOL

Your code is incomplete - you need a "loop()" function as well as "setup()".
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

console

i know that, im just confused about putting the if statements with the values and making it read the sensors properly

Arrch


i know that, im just confused about putting the if statements with the values and making it read the sensors properly


Well, what have you tried so far?

PeterH


i know that, im just confused about putting the if statements with the values and making it read the sensors properly


It doesn't sound as if you have any idea where to start. Have you done any coding at all? There are plenty of example sketches that show you how to read switches and turn on lamps and motors that will give you an idea of what the code would look like.

If you're not going to make any serious attempt to do it yourself then you should be posting under Gigs and Collaborations.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up