Overview
- Object ID : 5253 (2025-06-26 12:44:48)
- Author : Michael
- Content : Code
- Microcontroller : Propeller 1
- Language : SPIN
- Category : Sensor
- Licence : MIT
Content
Starting at Rev E, the Parallax Ping))) module adds a serial interface alongside the existing PWM protocol. The newer module is fully backward compatible.
The attached SPIN code example demonstrates how to use the new Serial mode:
The Serial mode example code sends a special pulse sequence to switch the Ping))) module into serial stream output at 9600 baud.
After that the Ping))) module continuously transmits the measurement data encoded as standard ASCII decimal with an ASCII carriage return delimiter. The measurement data is output in millimeters.
To enter Serial mode send 3x 100uS high pulses with 10uS low gaps between them.
To exit Serial mode (and return to default PWM mode) simply power-cycle the Ping))) module.