PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Functions
ping.h File Reference

Measure Ping))) Ultrasonic Distance Sensor values in cm, inches, or microsecond echo return times. More...

#include "simpletools.h"
+ Include dependency graph for ping.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int ping (int pin)
 Measure echo time in terms of Propeller system clock ticks. More...
 
int ping_cm (int pin)
 Report Ping))) measurement as a centimeter distance. More...
 
int ping_inches (int pin)
 Report Ping))) measurement as an inch distance. More...
 

Detailed Description

Measure Ping))) Ultrasonic Distance Sensor values in cm, inches, or microsecond echo return times.

Author
Andy Lindsay
Version
0.85

Definition in file ping.h.

Function Documentation

◆ ping()

int ping ( int  pin)

Measure echo time in terms of Propeller system clock ticks.

Parameters
pinNumber of the I/O pin to set to connected to the Ping))) sensor's SIG line.
Returns
the number of clock ticks it took for the Ping)))'s echo to return to it.
Examples
Ping_Demo.cpp.

Definition at line 3 of file ping.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ping_cm()

int ping_cm ( int  pin)

Report Ping))) measurement as a centimeter distance.

Parameters
pinNumber of the I/O pin to set to connected to the Ping))) sensor's SIG line.
Returns
measured centimeter distance.

Definition at line 11 of file ping.c.

+ Here is the call graph for this function:

◆ ping_inches()

int ping_inches ( int  pin)

Report Ping))) measurement as an inch distance.

Parameters
pinNumber of the I/O pin to set to connected to the Ping))) sensor's SIG line.
Returns
measured inch distance.

Definition at line 18 of file ping.c.

+ Here is the call graph for this function: