Adafruit MacroPad RP2040 no buzzer sound

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
snappawapa
 
Posts: 21
Joined: Tue Oct 15, 2013 7:50 pm

Adafruit MacroPad RP2040 no buzzer sound

Post by snappawapa »

Hey all! I hope this is in the right place in the forum.

I recently got myself one of these: https://learn.adafruit.com/adafruit-mac ... 40/arduino and am programming it with Arduino. I can upload new sketches just fine, but when I uncomment the speaker code in the setup() function, no sound is produced from the board. I have also tried adding a tone call to the loop() when the encoder button is pressed, but no luck there either. Any ideas?

Thanks in advance!

User avatar
snappawapa
 
Posts: 21
Joined: Tue Oct 15, 2013 7:50 pm

Re: Adafruit MacroPad RP2040 no buzzer sound

Post by snappawapa »

Realized I wasn't clear what code I am using. I am referencing the demo code on the page linked.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit MacroPad RP2040 no buzzer sound

Post by adafruit_support_carter »

You'll need to also enable the speaker by setting PIN_SPEAKER_ENABLE to HIGH.

Code: Select all

  pinMode(PIN_SPEAKER_ENABLE, OUTPUT);
  digitalWrite(PIN_SPEAKER_ENABLE, HIGH);

User avatar
snappawapa
 
Posts: 21
Joined: Tue Oct 15, 2013 7:50 pm

Re: Adafruit MacroPad RP2040 no buzzer sound

Post by snappawapa »

That did it! Should probably be added to the test code, so other's don't get tripped up like I did :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”