v1 Stable

Dependencies:   F401RE-USBHost USBHostXpad mbed

Revision:
13:d7c1aae2b48f
Parent:
12:0cc5d9260495
--- 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);