[Solved] How to play beeps?


#1

I tried arduboytones, but i only heard silence when doing tone(500, 500);

I want to play a simple beep, how do I do this?


(Stephane C) #2

First make sure you do this at the beginning of your sketch.

#include <ArduboyTones.h>
ArduboyTones sound(arduboy.audio.enabled);

Then for a simple beep

sound.tone(NOTE_E5,50);

NOTE_E5 can be change to any other note (E A G B D). The other number after the coma is the length if I am not mistake.


#3

I tried that, and I heard no sound. I’m using the Arduino IDE 1.8.7.


#4

Wait, forgot to do arduboy.begin(); :man_facepalming:


#5

Nope, still not hearing anything. :face_with_raised_eyebrow:


(Stephane C) #6

Ok that may sound silly to ask, but did you turn the sound off on another game recently?

On your Arduboy, before turning it on, press and hold B and while pressing B turn the Arduboy ON, you should see a blue LED light. While still holding B, press Up, the LED should turn green.

This should enable sound for sure…


#7

Thanks, it worked. :grinning: