To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 14837
14836  |  14838
Subject: 
Re: Racing Line Follower
Newsgroups: 
lugnet.robotics
Date: 
Mon, 2 Apr 2001 23:10:01 GMT
Viewed: 
651 times
  
In Creative Projects I make recommendations on line followers.  One of them is
to add a touch sensor that you can use as a trigger to grab the light levels of
the line and the surface and store them in memory.  Then you can use the
average of those two numbers as the point at which you can trigger the actions
of the motors, instead of a global variable like "41".  That way your
line-follower can work in any room without any re-downloading of a program.
especially good for competitions, etc. where the lighting in the room is
different from yours.

In lugnet.robotics, Magnus Fasting <pleboy@online.no> writes:
Hello

I've built a line follower which is quite fast (approx 4 secs per lap on
the testpad). It consists of two motors, each powering a 2/3 geared large
wheel. Two light sensors are attached to the front pivot wheel. The
distance between the sensors are 5 "lego units".

My problem is the program. I think it's too "uncomplicated". I guess i
could do more out of it, but i'm not a very good programmer.

Any suggestions to improvements in the program is appreciated.

The program:


#define white 41


task main() {
SetPower(OUT_A + OUT_C,8);
SetSensor(SENSOR_1,SENSOR_LIGHT);
SetSensor(SENSOR_3,SENSOR_LIGHT);

while(true) {
       while(SENSOR_1>white && SENSOR_3>white) {
       OnFwd(OUT_A + OUT_C);
       }

       while(SENSOR_1<white) {
       Off(OUT_A);
       Wait(2);
       OnFwd(OUT_A + OUT_C);
       }

       while(SENSOR_3<white) {
       Off(OUT_A);
       Wait(2);
       OnFwd(OUT_A + OUT_C);
       }

}
}

--

Magnus Fasting
E-mail: pleboy@online.no
Icq: 28291552






Message is in Reply To:
  Racing Line Follower
 
Hello I've built a line follower which is quite fast (approx 4 secs per lap on the testpad). It consists of two motors, each powering a 2/3 geared large wheel. Two light sensors are attached to the front pivot wheel. The distance between the sensors (...) (24 years ago, 2-Apr-01, to lugnet.robotics)

5 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR