evert-arias / EasyBuzzer

The Beep Library For Arduino

Home Page:https://evert-arias.github.io/EasyBuzzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work on Mega

mvackel opened this issue · comments

The lib seems to be directed to Atmega328 and ESP8266/32. It does not work on Mega2560.
To make it more general, I suggest the following change:
 

Line 69 (and simillarly on line 120):

#if defined __AVR_ATmega328P__  
	  noTone(mPin);
#endif // !	

#if defined ESP32
  ledcDetachPin(mPin);
#endif // !	

to:

#if defined ESP32
	  ledcDetachPin(mPin);
#else
  	  noTone(mPin);
#endif // !	

I will close this issue since it has been solved