PlaySFX (sound effect from Flash) example

Dependencies:   PokittoLib

Files at this revision

API Documentation at this revision

Comitter:
Pokitto
Date:
Fri Apr 05 11:18:51 2019 +0000
Parent:
18:b5f252ba0083
Commit message:
Added pure polling to buttons as an example

Changed in this revision

My_settings.h Show annotated file Show diff for this revision Revisions of this file
PokittoLib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/My_settings.h	Thu Apr 04 17:09:07 2019 +0000
+++ b/My_settings.h	Fri Apr 05 11:18:51 2019 +0000
@@ -7,5 +7,7 @@
 //#define PROJ_HIGH_RAM HIGH_RAM_MUSIC // put music buffers in SRAM1/2
 //#define PROJ_SDFS_STREAMING
 #define PROJ_AUD_FREQ 8000
+//
+#define PROJ_BUTTONS_POLLING_ONLY //use only polling (no interrupts) for buttons
 
 #endif
\ No newline at end of file
--- a/PokittoLib.lib	Thu Apr 04 17:09:07 2019 +0000
+++ b/PokittoLib.lib	Fri Apr 05 11:18:51 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/Pokitto/code/PokittoLib/#068fa6345036
+https://os.mbed.com/users/Pokitto/code/PokittoLib/#61a4ccb0a4b6
--- a/main.cpp	Thu Apr 04 17:09:07 2019 +0000
+++ b/main.cpp	Fri Apr 05 11:18:51 2019 +0000
@@ -17,7 +17,14 @@
                 Sound::playSFX(sfx_3_jump, sfx_3_jump_length);
                 Display::bgcolor++;
             }
-            Display::clear();
+            if(Buttons::aBtn()){
+                Display::print(1,1,"A");
+            }
+            if(Buttons::bBtn()){
+                Sound::playSFX(sfx_3_jump, sfx_3_jump_length);
+                Display::print(1,1,"B");
+            }
+            //Display::clear();
         }
     }
     return 0;