Bird
0
0

What is the main purpose of the DistanceSensor class in Raspberry Pi programming?

easy📝 Conceptual Q1 of 15
Raspberry Pi - gpiozero Library
What is the main purpose of the DistanceSensor class in Raspberry Pi programming?
ATo control the brightness of an LED
BTo measure the distance to an object using ultrasonic waves
CTo read temperature from a sensor
DTo send data over Wi-Fi
Step-by-Step Solution
Solution:
  1. Step 1: Understand the sensor type

    The DistanceSensor uses ultrasonic waves to detect how far an object is from the sensor.
  2. Step 2: Identify the purpose of the class

    The class provides an easy way to get distance measurements in meters from the sensor.
  3. Final Answer:

    To measure the distance to an object using ultrasonic waves -> Option B
  4. Quick Check:

    DistanceSensor purpose = measure distance [OK]
Quick Trick: DistanceSensor measures distance using sound waves [OK]
Common Mistakes:
  • Confusing DistanceSensor with LED control
  • Thinking it measures temperature
  • Assuming it sends data wirelessly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes