qub1750ul / Arduino_SharpIR

Arduino library that allows to acquire distance data from Sharp IR sensors
Creative Commons Attribution Share Alike 4.0 International
21 stars 11 forks source link

Fix issue return end of non-void function #8

Open klaasnicolaas opened 1 year ago

klaasnicolaas commented 1 year ago

In the current code with the switch function, a default is missing, which causes the following issue

..Arduino\libraries\SharpIR\src\SharpIR.cpp: In member function 'uint8_t SharpIR::getDistance(bool)':
..Arduino\libraries\SharpIR\src\SharpIR.cpp:41:2: error: control reaches end of non-void function [-Werror=return-type]
   41 |  }
      |  ^
cc1plus.exe: some warnings being treated as errors