Our plan is to follow the instructions and complete the task of the lesson plan.
## Results
### Exercise 1: Sensing different colors (floodlight on - reflective mode)
The exercise was done during the first hour of our work, starting from half past 2 pm, so the light was relatively bright (see following picture).
We made a note of this as we later repeated some measurements and the lighting had changed substantially, which we made sure to take into consideration
when discussing them.

By moving the NXT around and placing its sensor over different colors we obtained the following readings:
| Black | White | Yellow | Red | Green | Blue |
| --- | --- | --- | --- | --- | --- |
| 32 | 57 | 56 | 55 | 44 | 40 |
These reflective mode readings are used by the LineFollower program, which uses a threshold of 45 percent to distinguish between black and white.
This threshold is by our measurements a good threshold since it is approximately in the middle of the values of the readings for black and white,
and therefore is a resonable estimate for the reading that our sensor should pick up when right on the border between white/black.
Alternatively we could just have measured a reading exactly on the white/black border and used this as a threshold. We however suspect that if there
had been more light in the room, our readings would have been higher and the threshold might be too low, or conversely too high if the room was darker.

### Exercise 2: Sensing different colors (floodlight off - ambient mode)
The lighting level was the same as in exercise 1, as the measurements for the two exercises were performed immediately after each other.
| Black | White | Yellow | Red | Green | Blue |
| --- | --- | --- | --- | --- | --- |
| 20 | 40 | 38 | 40 | 36 | 36 |
We see here that the ambient-mode readings are much harder to seperate, as there wasn't a lot of light in the building. We expect that these would
have been better, if the test had been done outside in broad daylight. In our case it's still possible to differentiate between white and black,
but the other colors are very close (to each other and to white as well) in values.
If we wanted to determine whether it's night or day, ambient would be better than reflective, since the "fake light" from the floodlight does not
affect the reading, though there could of course be other light sources around for the sensor to read and misconstrue as daylight.
### Exercise 3: Trying out different sample intervals
The sample interval is used by the LineFollower program to stop reading sensor values for a given period of time before contacting the sensor again
and react on the resulting reading. When increasing this value, the system is saving power as it is performing fewer computations over a given time period.
It however also decreases accuracy of the program (on following the line) as it is now possible that a significant reading of color happens during a
program break and therefore isn't reacted on - e.g. a reading of black when looking for the line is missed and therefore the robot keeps on turning.
__10 ms__: The NXT follows the line very well.
__100 ms__: The higher interval results in the robot losing track of the line sometimes, as it measures white and turns right, but then passes the black line
before another sensor reading is requested (as described in the discussion above). The program then assumes that is hasn't reached the line yet, resulting in
the robot continuing in a circular motion until it hits the line again and either misses the significant reading again or registers that it has in fact
reached the line.
__500 ms__: This value results in quite a lot of circles. Sometimes brief corrections, when serendipity causes it to request a reading when right above
the black line.
__1000 ms__: Perhaps we now know how crop circles are made.
From this little experiment with the sample interval, we conclude that the 10 ms value works the best among the tested values. We could however have tried
values between 10 and 100 since the latter wasn't that bad, and a higher value would increase battery life.
### Exercise 4:
The data and the plots show exactly what we observed in exercise 3. For 10 ms we get a nice and steady curve with just abour equal amounts of white and black
readings. For 100 ms we get the same except for a few spikes where we miss a black reading and do a 180-degree turn. For 500 ms we get many more white
readings than black, and for 1000 ms we almost don't get any black readings.