Αποστασιόμετρο#
Εισαγωγή#
Το Υπερηχητικό Αποστασιόμετρο μετρά την απόσταση από το πλησιέστερο αντικείμενο χρησιμοποιώντας ηχητικά κύματα. Λειτουργεί στέλνοντας έναν υπερηχητικό παλμό και μετρώντας πόσο χρόνο χρειάζεται για να ανακλαστεί ο ήχος.

This page uses range_finder as the example Range Finder name. Replace it with your own configured name as needed.
Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:
found_object– Returns whether the Range Finder detects an object.distance– Returns the distance between the Range Finder and the nearest detected object.
Κατασκευαστές – Χειροκίνητη αρχικοποίηση ενός μετρητή αποστάσεων.
Sonar– Create a Range Finder.
βρέθηκε_αντικείμενο#
found_object returns a Boolean indicating whether the Range Finder detects an object within its field of view.
True– The Range Finder is detecting an object.False– The Range Finder is not detecting an object.
Usage:
range_finder.found_object()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
απόσταση#
distance returns the measured distance to the nearest object detected by the sensor as a decimal float.
Usage:
range_finder.distance(units)
Παράμετρος |
Περιγραφή |
|---|---|
|
The unit that will represent the distance: |
Κατασκευαστές#
Constructors are used to manually create Sonar objects, which are necessary for configuring Range Finders outside of VEXcode.
Sonar#
Sonar creates a Range Finder.
Usage:
Sonar(port)
Παράμετρος |
Περιγραφή |
|---|---|
|
The 3-Wire Port that the Range Finder is connected to:
|
# Create a Range Finder in Port A
range_finder = Sonar(brain.three_wire_port.a)