No commit message authored by Jesper Kurtzmann Svith's avatar Jesper Kurtzmann Svith
No commit message
...@@ -82,20 +82,21 @@ ...@@ -82,20 +82,21 @@
> >
> Code snippet from ThreeColorSensor class: > Code snippet from ThreeColorSensor class:
> ``` > ```
public boolean white() { > public boolean white() {
greenCount = 0; > greenCount = 0;
return (ls.readNormalizedValue()> whiteGreenThreshold); > return (ls.readNormalizedValue()> whiteGreenThreshold);
} > }
>
//Returns true if threshold is under white and over black > //Returns true if threshold is under white and over black
public boolean green() { > public boolean green() {
greenCount += greenCount + 1; > greenCount += greenCount + 1;
if (greenCount > 300) > if (greenCount > 300)
return (ls.readNormalizedValue()>whiteGreenThreshold && ls.readNormalizedValue()> greenBlackThreshold); > return (ls.readNormalizedValue()>whiteGreenThreshold && ls.readNormalizedValue()> > greenBlackThreshold);
else return false; > else return false;
} > }
> ``` > ```
> >
>
>#### Result! >#### Result!
>As can be seen in video (??), the ThreeColorSensor program makes the robot follow the black line oscillating in small turns between the black and the white areas untill it enters the green area. >The movement is not very smooth however, >As can be seen in video (??), the ThreeColorSensor program makes the robot follow the black line oscillating in small turns between the black and the white areas untill it enters the green area. >The movement is not very smooth however,
> >
... ...
......