Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
sonar_trigger_echo.ranger Class Reference

Public Member Functions

def __init__ (self, pi, trigger, echo)
 
def cancel (self)
 
def read (self)
 

Public Attributes

 pi
 

Private Member Functions

def _cbf (self, gpio, level, tick)
 

Private Attributes

 _cb
 
 _echo
 
 _echo_mode
 
 _high
 
 _inited
 
 _ping
 
 _time
 
 _trig
 
 _trig_mode
 
 _triggered
 

Detailed Description

This class encapsulates a type of acoustic ranger.  In particular
the type of ranger with separate trigger and echo pins.

A pulse on the trigger initiates the sonar ping and shortly
afterwards a sonar pulse is transmitted and the echo pin
goes high.  The echo pins stays high until a sonar echo is
received (or the response times-out).  The time between
the high and low edges indicates the sonar round trip time.

Definition at line 7 of file sonar_trigger_echo.py.

Constructor & Destructor Documentation

def sonar_trigger_echo.ranger.__init__ (   self,
  pi,
  trigger,
  echo 
)
The class is instantiated with the Pi to use and the
gpios connected to the trigger and echo pins.

Definition at line 19 of file sonar_trigger_echo.py.

Member Function Documentation

def sonar_trigger_echo.ranger._cbf (   self,
  gpio,
  level,
  tick 
)
private

Definition at line 45 of file sonar_trigger_echo.py.

def sonar_trigger_echo.ranger.cancel (   self)
Cancels the ranger and returns the gpios to their
original mode.

Definition at line 79 of file sonar_trigger_echo.py.

def sonar_trigger_echo.ranger.read (   self)
Triggers a reading.  The returned reading is the number
of microseconds for the sonar round-trip.

round trip cms = round trip time / 1000000.0 * 34030

Definition at line 60 of file sonar_trigger_echo.py.

Member Data Documentation

sonar_trigger_echo.ranger._cb
private

Definition at line 40 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._echo
private

Definition at line 26 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._echo_mode
private

Definition at line 35 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._high
private

Definition at line 29 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._inited
private

Definition at line 43 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._ping
private

Definition at line 28 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._time
private

Definition at line 30 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._trig
private

Definition at line 25 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._trig_mode
private

Definition at line 34 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger._triggered
private

Definition at line 32 of file sonar_trigger_echo.py.

sonar_trigger_echo.ranger.pi

Definition at line 24 of file sonar_trigger_echo.py.


The documentation for this class was generated from the following file:


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Tue Oct 20 2020 03:35:58