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!

Files at this revision

API Documentation at this revision

Comitter:
Pokitto
Date:
Wed Apr 18 08:11:53 2018 +0000
Parent:
36:771321e70814
Child:
38:0daee0048ef4
Commit message:
Improved button handling

Changed in this revision

POKITTO_HW/HWButtons.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/POKITTO_HW/HWButtons.cpp	Mon Apr 02 22:37:22 2018 +0000
+++ b/POKITTO_HW/HWButtons.cpp	Wed Apr 18 08:11:53 2018 +0000
@@ -66,20 +66,20 @@
     Pokitto::heldStates[BTN_C] = 1;
     }
 void CReleased() { Pokitto::heldStates[BTN_C] = 0; }
-void UPressed() { Pokitto::heldStates[BTN_UP] = 1; }
+void UPressed() { Pokitto::heldStates[BTN_UP] = 1; Pokitto::heldStates[BTN_DOWN] = 0; }
 void UReleased() { Pokitto::heldStates[BTN_UP] = 0; }
-void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; }
+void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; Pokitto::heldStates[BTN_UP] = 0;}
 void DReleased() { Pokitto::heldStates[BTN_DOWN] = 0; }
 void RPressed() {
     /* Hardware volume control */
     if (Pokitto::heldStates[BTN_C]) _s.volumeUp();
-    else Pokitto::heldStates[BTN_RIGHT] = 1;
+    else { Pokitto::heldStates[BTN_RIGHT] = 1 ; Pokitto::heldStates[BTN_LEFT] = 0;}
     }
 void RReleased() { Pokitto::heldStates[BTN_RIGHT] = 0; }
 void LPressed() {
     /* Hardware volume control */
     if (Pokitto::heldStates[BTN_C]) _s.volumeDown();
-    else Pokitto::heldStates[BTN_LEFT] = 1;
+    else {Pokitto::heldStates[BTN_LEFT] = 1; Pokitto::heldStates[BTN_RIGHT] = 0;}
     }
 void LReleased() { Pokitto::heldStates[BTN_LEFT] = 0; }