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.
Dependencies: F401RE-USBHost USBHostXpad mbed
Revision 13:d7c1aae2b48f, committed 2017-04-15
- Comitter:
- Ownasaurus
- Date:
- Sat Apr 15 14:00:16 2017 +0000
- Parent:
- 12:0cc5d9260495
- Commit message:
- fixed sensitivity bug; changed default deadzone/sensitivity
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Apr 15 02:19:42 2017 +0000
+++ b/main.cpp Sat Apr 15 14:00:16 2017 +0000
@@ -101,8 +101,8 @@
@brief makes the range of the triggers 0 to 10
*/
const float tN=0.03921568627;//(10/255)
-const int dead_zone = 20;
-const int sensitivity = 100;
+const int dead_zone = 5;
+const int sensitivity = 66;
const int TRIGGER_THRESHOLD = 5;
char reverse(char b)
@@ -507,7 +507,8 @@
// ----- begin nrage replication analog code -----
const float XPAD_MAX = 32768;
- const float N64_MAX = (sensitivity > 0) ? 127/sensitivity : 0;
+ const float N64_MAX = (sensitivity > 0) ? 127*(sensitivity/100.0f) : 0;
+ //const float N64_MAX = 127;
float deadzoneValue = (dead_zone/100.0f) * XPAD_MAX;
float deadzoneRelation = XPAD_MAX / (XPAD_MAX - deadzoneValue);