Arduboy-homemade-package/board-package-source/libraries/ATMlib/examples/noteCut/noteCut02/noteCut02.ino

35 lines
777 B
Arduino
Raw Normal View History

#include <Arduino.h>
#include <Arduboy2.h>
#include <ATMlib.h>
#include "bitmaps.h"
#include "song.h"
Arduboy2Base arduboy;
Sprites sprites;
ATMsynth ATM;
void setup() {
arduboy.begin();
// set the framerate of the game at 60 fps
arduboy.setFrameRate(60);
// Initializes ATMSynth and samplerate
// Begin playback of song.
// Lower the tempo ever so slightly
arduboy.audio.on();
ATM.play(music);
}
void loop() {
if (!(arduboy.nextFrame())) return;
arduboy.pollButtons();
arduboy.clear();
for (byte i = 0; i < 4; i++) sprites.drawSelfMasked(32 * i, 10, TEAMarg, i);
sprites.drawSelfMasked(43, 50, TEAM_argPart5, 0);
if (arduboy.justPressed(B_BUTTON)) ATM.playPause();
if (arduboy.justPressed(A_BUTTON)) ATM.playPause();
arduboy.display();
}