@@ -23,10 +23,12 @@ Follow the instructions given in the lesson plan \[1\].
First, you should mount the sensor on the LEGO 9797 car as described in LEGO Mindstorms Education NXT Base Set 9797 building instruction page 32 to page 34. Second, make a program that use and test the class *BlackWhiteSensor.java*. After calibration, place the car with the light sensor over different dark and bright areas and investigate how well the BlackWhiteSensor works.
#### Execution ####
First, we rebuilt the robot to utilise a light sensor. Our initial construction can be seen in <<<<<<indsætreferencetilbilledether>>>>>>.
First, we rebuilt the robot to utilize a light sensor. Our initial construction can be seen in Figure 1.
Secondly, we programmed an application which used the *BlackWhiteSensor.java*<<<<<<indsætreferencetilkodenher>>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsætkodeellerreferencetilgitmedkode>>>>>>. We used this application to analyse the effectiveness of application calibration.
*Figure 1 : The initial construction of the robot, Note hight of sensor location*
The *BlackWhiteSensor.java* class prints light values to the display as a percentage <<<<indsætreferencetilhvordetteerkendtfra>>>>>. We noted these in table <<<<<tableref>>>>>.
**White** | **Black**
...
...
@@ -34,8 +36,10 @@ The *BlackWhiteSensor.java* class prints light values to the display as a percen
51 | 33
We noticed that the application was very effective at classifying the differences between black and white. It does this by calculating the median between the black and white readings and setting this value as the threshold between the two colors.
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be in <<<<<indsætreftilbillede>>>>>>.
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be seen in Figure 2.