eliteio / Arduino_New_Ping

New Ping Library from http://playground.arduino.cc/Code/NewPing
12 stars 5 forks source link

missing void on NewPing::begin() #4

Open e-tinkers opened 4 years ago

e-tinkers commented 4 years ago

You may want to correct the error on your NewPing::begin() method declaration on NewPing.cpp line 35. It cause this error during compilation:

C:\Users\somebody\Documents\Arduino\libraries\Arduino_New_Ping-master\src\NewPing.cpp:35:16: warning: ISO C++ forbids declaration of 'begin' with no type [-fpermissive]

NewPing::begin() {

^

C:\Users\somebody\Documents\Arduino\libraries\Arduino_New_Ping-master\src\NewPing.cpp:35:1: error: prototype for 'int NewPing::begin()' does not match any in class 'NewPing'

NewPing::begin() {

^~~~~~~

In file included from C:\Users\somebody\Documents\Arduino\libraries\Arduino_New_Ping-master\src\NewPing.cpp:8:0:

C:\Users\somebody\Documents\Arduino\libraries\Arduino_New_Ping-master\src\NewPing.h:213:10: error: candidate is: void NewPing::begin()

void begin();

^~~~~

exit status 1

It should be:

void NewPing::begin() {

}
ScruffR commented 4 years ago

I have now pushed the correction, but I'm not the owner of the library, so I cannot upload it to the Public Particle Library repository. @kennethlimcp, can you do that?