Tue Aug 12, 2014 5:10 pm
gb.sound.playPattern(myPattern, 0);
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
const uint16_t myPattern[] PROGMEM = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};
void setup(){
gb.begin();
gb.titleScreen(F("playPattern Example"));
}
void loop(){
if(gb.update()){
gb.display.println(F("Press \25 to play");
if(gb.buttons.pressed(BTN_A)){
gb.sound.playPattern(myPattern, 0);
}
if(gb.buttons.pressed(BTN_C)){
gb.titleScreen(F("playPattern Example"));
}
}
}
Wed Aug 13, 2014 11:24 am
Wed Aug 13, 2014 1:22 pm
chanOutput[channel] = (byte) (rand % (chanOutputVolume[channel] & 0xff));
Wed Aug 13, 2014 7:43 pm
Wed Aug 13, 2014 9:04 pm
Wed Aug 13, 2014 9:13 pm
Pattern startupSound = new Pattern(new char[] {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000});
soundGen.playPattern(startupSound, (byte) 0);