Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: YATTT sd_map_test cPong SnowDemo ... more
PokittoLib
Library for programming Pokitto hardware
How to Use
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
Revision 37:dc085d77d849, committed 2018-04-18
- 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; }