PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

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:
68:61a4ccb0a4b6
Parent:
66:6281a40d73e6
--- a/POKITTO_CORE/PokittoButtons.cpp	Thu Apr 04 17:07:28 2019 +0000
+++ b/POKITTO_CORE/PokittoButtons.cpp	Fri Apr 05 11:18:14 2019 +0000
@@ -56,6 +56,9 @@
     #if POK_USE_CONSOLE
     if (console.conscounter) return;
     #endif // POK_USE_CONSOLE
+    #ifdef PROJ_BUTTONS_POLLING_ONLY
+    pollButtons();
+    #endif
     #ifndef POK_SIM
         /** HARDWARE CODE **/
     for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
@@ -199,7 +202,11 @@
     #ifdef POK_SIM
     return simulator.aBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_A];
+    #else
+    return Pokitto::Core::aBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -208,7 +215,11 @@
     #ifdef POK_SIM
     return simulator.bBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_B];
+    #else
+    return Pokitto::Core::bBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -217,7 +228,11 @@
     #ifdef POK_SIM
     c = simulator.cBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     c = Pokitto::heldStates[BTN_C];
+    #else
+    return Pokitto::Core::cBtn();
+    #endif
     #endif // POK_SIM
     return c;
 }
@@ -226,7 +241,11 @@
     #ifdef POK_SIM
     return simulator.leftBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_LEFT];
+    #else
+    return Pokitto::Core::leftBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -234,7 +253,11 @@
     #ifdef POK_SIM
     return simulator.rightBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_RIGHT];
+    #else
+    return Pokitto::Core::rightBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -242,7 +265,11 @@
     #ifdef POK_SIM
     return simulator.upBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_UP];
+    #else
+    return Pokitto::Core::upBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -250,7 +277,11 @@
     #ifdef POK_SIM
     return simulator.downBtn();
     #else
+    #ifndef PROJ_BUTTONS_POLLING_ONLY
     return Pokitto::heldStates[BTN_DOWN];
+    #else
+    return Pokitto::Core::downBtn();
+    #endif
     #endif // POK_SIM
 }
 
@@ -262,4 +293,3 @@
 
 
 //** EOF **//
-