PING+ for PING))) and LaserPING

Consolidated interface for PING))) and LaserPING sensors. May use pulse or serial mode.

Share this object
<

Overview

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. Smart pin modes are used for pulse measurement and serial input.

The demo program has been tested with Propeller Tool, Spin Tools IDE, and FlexProp (see the COMPILER constant setting in the program).


Downloads  
Zip archive download

Leave a Reply