Overview
- Object ID : 5271 (2025-07-03 17:29:35)
- Author : Jon McPhalen
- Content : Code
- Microcontroller : Propeller 1
- Language : SPIN
- Category : Sensor
- Licence : MIT
- Tags : jonnymac, LaserPING, PING))), Sensor
Content
This object simplifies the use of PING))) and LaserPING sensors with the P1. The interface works in classic pulse mode, and supports serial mode for LaserPING and PING))) Rev E or later. Helpful object methods provide the tools needed by applications.
- get_us() (distance in microseconds, pulse mode only)
- get_mm()
- get_cm()
- get_tenths() (0.1-inch units)
- get_inches()
- in_range()
Note: Using either sensor in serial mode does not require a cog, saving valuable resources.
The demo program has been tested with Propeller Tool, Spin Tools IDE, and FlexProp (see the COMPILER constant setting in the program).