PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Simple Libraries
Sensor
libping
ping.c
1
#include "simpletools.h"
2
3
int
ping(
int
pin)
4
{
5
low(pin);
6
pulse_out(pin, 10);
7
return
pulse_in(pin, 1);
8
}
9
10
int
ping_cm(
int
pin)
11
{
12
long
tEcho = ping(pin);
13
int
cmDist = tEcho / 58;
14
return
cmDist;
15
}
16
17
int
ping_inches(
int
pin)
18
{
19
long
tEcho = ping(pin);
20
int
inDist = tEcho / 148;
21
return
inDist;
22
}
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12