hello! have linefollower pretty fast, want improve more using pid control have seen in internet. have tried multiple ways make work can't seem it. write code me? know shouldnt hard experienced programmers. controller use arduino leonardo. on board manually soldered. time!
linefollower has 6 ir sensors, shematic of them in attachments, small , placed in straight line next each other no spaces inbetween. connected a5; a4; a3; a2; a1; a0 sensors defined #define sen1 analogread(a5)>550
this code driving functions, lefts - speed left motor, rights - speed right motor.
linefollower has 6 ir sensors, shematic of them in attachments, small , placed in straight line next each other no spaces inbetween. connected a5; a4; a3; a2; a1; a0 sensors defined #define sen1 analogread(a5)>550
this code driving functions, lefts - speed left motor, rights - speed right motor.
code: [select]
pinmode(10,output);// left motor
pinmode(9,output);// right motor
pinmode(8,output);// direction left motor
pinmode(6,output);// direction right motor
void driveforward (int lefts , int rights) {
analogwrite(10,lefts);
analogwrite(9,rights);
digitalwrite(8,high);
digitalwrite(6,low); }
void drivebackward (int lefts , int rights) {
analogwrite(10,lefts);
analogwrite(9,rights);
digitalwrite(8,low);
digitalwrite(6,high); }
void driveleft (int lefts , int rights) {
analogwrite(10,lefts);
analogwrite(9,rights);
digitalwrite(8,low);
digitalwrite(6,low); }
void driveright (int lefts , int rights) {
analogwrite(10,lefts);
analogwrite(9,rights);
digitalwrite(8,high);
digitalwrite(6,high);
}
i'll move it, sure reads want work you.
my wife teaching 7th graders how lego controller years ago.
what using line sensor? please explain optoisolater doing you.
my wife teaching 7th graders how lego controller years ago.
what using line sensor? please explain optoisolater doing you.
Arduino Forum > Topics > Robotics (Moderator: fabioc84) > PID Linefollower
arduino
Comments
Post a Comment