NewPing Library for Arduino Author: Tim Eckel Contact: email@example.com
|1.8||07/30/2016||Added support for non-AVR microcontrollers. Can now set a new max distance when pinging. Added support for ATmega16, ATmega32 and ATmega8535 microcontrollers. Changed convert_cm() and convert_in() methods to static members so you can call them directly.|
|1.7||09/29/2015||Removed Due and Zero compatibility because boards are 3.3 volts and not 5 volt tolerant.|
|1.6||06/17/2014||Support for new Arduino boards and ultrasonic sensors. Better timeout method.|
|1.5||8/15/2012||New ping_median() method does multiple pings and returns the median (digital filter).|
|1.4||7/14/2012||Interface with sensors using only one Arduino pin.|
|1.3||6/8/2012||Supports a timer-based ping method.|
|1.2||5/25/2012||Rebuilt the ping timing code from scratch, now yields very accurate results.|
|1.1||5/16/2012||Uses port registers for ultra-fast and lean code.|
When I first received an ultrasonic sensor I was not happy with how poorly it performed. I soon realized the problem wasn't the sensor, it was the available ping and ultrasonic libraries causing the problem. The NewPing library totally fixes these problems, adds many new features, and breathes new life into these very affordable distance sensors.
Download here: Download NewPing Library
NewPing sonar(trigger_pin, echo_pin [, max_cm_distance]);
NewPing sonar(12, 11, 200);
This initializes NewPing to use pin 12 for trigger output, pin 11 for echo input, with a maximum ping distance of 200cm. max_cm_distance is optional [default = 500cm]. If connecting using a single pin, specify the same pin for both trigger_pin and echo_pin as the same pin is doing both functions.
|Last Modified:||November 11, 2016, at 09:40 AM|