EasyManua.ls Logo

LEGO MINDSTORMS Robots

LEGO MINDSTORMS Robots
226 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Page 188
sub initialize() {
SetSensor(BUMP_SENSOR, SENSOR_TOUCH);
SetSensor(LIGHT_SENSOR, SENSOR_LIGHT);
ClearMessage();
score = 0;
Fwd(OUT_B);
SelectDisplay(5);
calibrateLightSensor();
}
#define NUMBER_OF_SAMPLES 10
int i;
int runningTotal;
void calibrateLightSensor() {
// Take an average light reading.
i = 0;
runningTotal = 0;
while (i < NUMBER_OF_SAMPLES) {
runningTotal += LIGHT_SENSOR;
Wait(10);
i += 1;
}
averageLight = runningTotal / NUMBER_OF_SAMPLES;
}
Online Resources
mattdm's Mindstorms stuff
http://www.mattdm.org/mindstorms/
This is the original RoboTag web page, created by Matthew Miller. It contains the original source code and a couple of movies of RoboTag in action.
Brooks' Subsumption Architecture
http://ai.eecs.umich.edu/cogarch3/Brooks/Brooks.html
This page has some background on subsumption architecture. If you really want to learn more, however, you should look up Brooks' papers; they're an excellent read.
Page 189
10
legOS

Table of Contents

Related product manuals