Maximum sound animation test for Pokitto. BE CAREFUL, it is loud. You can also test buttons.

Dependencies:   PokittoLib

Fork of HelloWorld by Pokitto Community Team

A sound / buttons testing program. Put feelgood.snd on SD card (11kHz 8- bit unsigned raw sample) to hear sound

Revision:
9:67877833c19e
Parent:
3:53db531e03aa
--- a/Animation.cpp	Mon Apr 02 22:46:58 2018 +0000
+++ b/Animation.cpp	Wed May 02 06:14:30 2018 +0000
@@ -1,4 +1,4 @@
-#include "Pokitto.h"
+#include "PokittoCore.h"
 #include "Animation.h"
 
 #define X_L_EYE 6
@@ -37,23 +37,8 @@
     gb.display.print(c);
 }
 
-void pout (char* text) {
-    gb.display.enableDirectPrinting(true);
-    gb.display.setCursor(0,0);
-    gb.display.print(text);
-    wait_ms(3000);
-    }
-    
-void pout (int val) {
-    gb.display.enableDirectPrinting(true);
-    gb.display.setCursor(0,0);
-    gb.display.print(val);
-    wait_ms(3000);
-    }
-
-
 int main () {
-    gb.begin();
+    pokInitSD();
     gb.sound.playMusicStream("feelgood.SND");
     int16_t x,y,x_lpupil,x_rpupil,y_pupil, squint=1;
     uint8_t mouth=0,eyes=1,blink=0,blinkcount=0, eyecount=0, grincounter=0, grinout=GRINOUT;
@@ -61,7 +46,7 @@
     bool talking=false;
 
     x_lpupil = X_LPUPIL; x_rpupil = X_RPUPIL; y_pupil=Y_PUPIL;
-    //gb.begin();
+    gb.begin();
     gb.display.load565Palette(m_anim_pal);
     gb.display.bgcolor=10;
     gb.display.clear();
@@ -181,7 +166,7 @@
         if (random(0xfff)>TALKPROBABILITY) {
                 uint8_t oldmouth = mouth;
                 mouth = random(3)+1;
-                if (oldmouth==mouth) mouth++;
+                if (oldmouth=mouth) mouth++;
                 if (mouth==5) mouth = 1;
         }
         } else {
@@ -229,4 +214,3 @@
 }
 
 
-