Jonne Valola / PokittoLib Featured

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Revision:
2:968589ca3484
Parent:
1:4b1511a0a2c2
Child:
4:ecf2fe370c1c
--- a/POKITTO_CORE/PokittoSound.cpp	Mon Sep 18 12:34:05 2017 +0000
+++ b/POKITTO_CORE/PokittoSound.cpp	Tue Sep 19 08:47:36 2017 +0000
@@ -147,6 +147,7 @@
 uint8_t _chanOutput[NUM_CHANNELS]; //current value of the outputted waveform
 bool _chanNoise[NUM_CHANNELS]; //if a random value should be added to the waveform to generate noise
 
+#if POK_GBSOUND > 0
 const uint16_t squareWaveInstrument[]  = {0x0101, 0x03F7};
 const uint16_t noiseInstrument[]  = {0x0101, 0x03FF};
 const uint16_t* const defaultInstruments[]  = {squareWaveInstrument,noiseInstrument};
@@ -154,7 +155,7 @@
 const uint16_t playOKPattern[]  = {0x0005,0x138,0x168,0x0000};
 const uint16_t playCancelPattern[]  = {0x0005,0x168,0x138,0x0000};
 const uint16_t playTickP[]  = {0x0045,0x168,0x0000};
-
+#endif
 #if(EXTENDED_NOTE_RANGE > 0)
 //extended note range
 #define NUM_PITCH 59
@@ -441,7 +442,7 @@
 		return;
 	switch(cmd){
 	case CMD_VOLUME: //volume
-	    X = constrain(X, 0, 10);
+	    X = constrain((int8_t)X, 0, 10);
 		noteVolume[i] = X;
 		break;
 	case CMD_INSTRUMENT: //instrument
@@ -845,6 +846,7 @@
     return Pokitto::ampIsOn();
     #endif
     #endif // POK_SIM
+    return 0;
 }
 
 void Sound::ampEnable(uint8_t v) {
@@ -860,7 +862,7 @@
 
 int Sound::playMusicStream(char* filename)
 {
-    playMusicStream(filename,0);
+    return playMusicStream(filename,0);
 }
 
 int Sound::playMusicStream()