18
Forward Until Dark

Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Embed Size (px)

Citation preview

Page 1: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Forward Until Dark

Page 2: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

NXT Light Sensors

Page 3: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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.

Page 4: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Forward Until Dark Program

Page 5: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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

Page 6: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Establishing The Light Threshold

Page 7: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Establishing The Dark Threshold

Page 8: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Calculating The Threshold

Page 9: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Motor Block One Details

Page 10: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Light Sensor Block Two Details

Page 11: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Motor Block Three Details

Page 12: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Test Your Robot

Page 13: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Forward Until Light

Page 14: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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

Page 15: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

Test Your Robot

Page 16: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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

Page 17: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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

Page 18: Forward Until Dark. NXT Light Sensors How does the Light Sensor detect brightness? The Light Sensor shines a red light on the surface below it and reports

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.