---
title: Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo
description: "![](/qbi/Ping))) Ultrasonic Distance Sensor With Graphical Debug Demo - Parallax_files/Ping-on-PCB.jpg) ##### Description The Ping))) object provides the distance from the sensor connected to an I/O pin through a 3.3k to 4.7k resistor. The object returns the distance in microseconds, or…"
url: "https://obex.parallax.com/docs/quick-bytes/propeller-2/ping-ultrasonic-distance-sensor-with-graphical-debug-demo/"
updated: "2026-09-29"
category: Propeller 2
---

# Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo

![](/qbi/Ping))) Ultrasonic Distance Sensor With Graphical Debug Demo - Parallax_files/Ping-on-PCB.jpg)

##### Description

The Ping))) object provides the distance from the sensor connected to an I/O pin through a 3.3k to 4.7k resistor. The object returns the distance in microseconds, or a 0 value if missing or bad sensor. The example uses smart pins and can be replicated for as many Ping))) sensors as needed. The values are provided in inches, tenths of inches, millimeters, and centimeters. The LaserPING 2m Rangefinder is also compatible with this code example.   

Two source code archives are included. The first archive is a test with a terminal program and the second archive is a demonstration using the graphical debug features built into Propeller Tool for Windows. 

[Quick Byte: Ping))) Ultrasonic Sensor Demo](https://www.youtube.com/embed/nx5MaylvAIg?feature=oembed)

##### Parts Used

- [P2 Edge Module](https://www.parallax.com/product/p2-edge-module/)
- [P2 Edge Breadboard](https://www.parallax.com/product/p2-edge-module-breadboard/)
- [Ping))) Ultrasonic Distance Sensor](https://www.parallax.com/product/ping-ultrasonic-distance-sensor/)
- [LaserPING 2m Rangefinder](https://www.parallax.com/product/laserping-2m-rangefinder/)

##### Source Code

- [jm_ping_test - Archive.zip](/qbi/downloads/jm_ping_test-Archive-Date-2022.05.23-Time-06.30.zip)
- [jm_ping_test_plot - Archive.zip](/qbi/downloads/jm_ping_test_plot-Archive-Date-2022.05.23-Time-06.30.zip)

##### Programming Language

- [Spin 2](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/)
- [PASM2](https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/)

##### Tools and Operating System

- [PNut](https://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v35g-debug-exception-bugs-fixed/p1)
- [Propeller Tool for Windows](https://www.parallax.com/package/propeller-tool-software-for-windows-spin-assembly-2/)

##### Additional Resources

- [Propeller 2 Spin Documentation](https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit)
- [Graphical Debug Tools in Spin2](https://www.parallax.com/propeller-2-graphical-debug-tools-in-spin2/)

##### Document Author

- Ken Gracey

##### Source Code Author

- Jon McPhalen
