Arduboy sound example

Task:

Play simple sound on the Arduboy device:

Implementation:

#include <Arduboy2.h>
#include <ArduboyTones.h>

Arduboy2 arduboy;
ArduboyTones sound(arduboy.audio.enabled);

void setup() {
  // initiate arduboy instance
  arduboy.begin();
  arduboy.audio.on(); // Turn the sound on.
}

void loop() {
  arduboy.clear();

  arduboy.setCursor(0, 0);
  arduboy.println("Print simple sound...");

  sound.tone(300, 100); // Play simple sound.
  delay(1000);
}

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :