forward until dark. nxt light sensors how does the light sensor detect brightness? the light sensor...

Post on 31-Mar-2015

217 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Forward Until Dark

NXT Light Sensors

NXT Light Sensors

• How does the Light Sensor detect brightness?

• The Light Sensor shines a red light on the surface below it and reports how much of that light is reflected back.A bright surface will reflect a lot of light and give a high reading. A dark surface will reflect less light and give a low reading.

Forward Until Dark Program

Establishing The Threshold

• On the NXT – Select the View Mode– Select Reflected Light– Select Port 3

• Position the robot over the surface to be read by the light sensor as shown in the next two slides

Establishing The Light Threshold

Establishing The Dark Threshold

Calculating The Threshold

Motor Block One Details

Light Sensor Block Two Details

Motor Block Three Details

Test Your Robot

Forward Until Light

Forward Until Light Light Sensor Block Two Details

Wait for the Light Sensor on Port 3 to get a Light reading

Light = Light Sensor value>Threshold value

Test Your Robot

Calculating Thresholds Quiz

Would the robot classify the following Light Sensor readings as Light or Dark?

a. Sensor = 15 with Threshold = 40

b. Sensor = 55 with Threshold = 40

c. Sensor = 49 with Threshold = 56

d. Sensor = 15 with Dark = 10 and Light = 30

e. Sensor = 55 with Dark = 43 and Light = 62

Calculating Thresholds Quiz Answers

a. Sensor = 15 with Threshold = 40Sensor value is less than Threshold therefore it is darkb. Sensor = 55 with Threshold = 40Sensor value is greater than Threshold therefore it is lightc. Sensor = 49 with Threshold = 56Sensor value is less than Threshold therefore it is dark

Calculating Thresholds Quiz Answers

d. Sensor = 15 with Dark = 10 and Light = 30The threshold is (10+30)/2=20 The Sensor Value is less than Threshold, therefore it is Dark. Intuitively - the Sensor value is closer to Dark than Light,

therefore it is dark e. Sensor = 55 with Dark = 43 and Light = 62 The threshold is (43+62)/2=52 The Sensor Value is greater than Threshold, therefore it is Light. Intuitively - the Sensor value is closer to light than dark. Therefore it is light.

top related