dancol90 / ESP8266Ping

Ping library for ESP8266 Arduino core
GNU Lesser General Public License v2.1
261 stars 134 forks source link

Average Time, Debug Infos ? #25

Closed Greece2 closed 4 years ago

Greece2 commented 4 years ago

How can one enable the debug function of this lib ENABLE_DEBUG_PING without having to make changes to the lib itself ? How can one print aditional info like number of errors, average time etc. ? Nothing about that in the Demos.

Thanks ! I'm a newby, so excuse my questions ;-)

dancol90 commented 4 years ago

Hi! Just add the define before including the library in your sketch:

#define ENABLE_DEBUG_PING
#include <ESP8266Ping.h>
Greece2 commented 4 years ago

Hi! I'll give that a try, thanks ! I found out that int avg_time_ms = Ping.averageTime(); Serial.print("Av.Time: "); Serial.println(avg_time_ms); prints the average repsonse time :-)