What does sensor mean?
A device that measures something about the world and turns it into a value the program can read: distance, position, heading, an image.
In a lesson
So far the robot has driven blind. Now it looks ahead. On its front is a time-of-flight sensor: it fires invisible light and times the reflection.
distance()tells you how far it is to the nearest thing straight ahead.
Learn it
- Taught in 2.2 The distance sensor Sensing, Robot club
Used in
- F1.9 Arithmetic operators
- F2.6 Condition-controlled loops: while
- F2.8 Project: parking sensor
- F3.3 Lists: one-dimensional arrays
- F3.4 Iterating over a list
- F3.5 Two-dimensional arrays
- F5.2 Flowcharts
- F5.4 Trace tables
- F6.4 Debugging logic errors
- F9.1 Logic gates and truth tables
and 106 more lessons.
Do the lesson in the simulator