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: USBHost USBHostXpad mbed-rtos mbed
Diff: utils.cpp
- Revision:
- 3:c1620db50a75
- Parent:
- 0:79485480cd7e
--- a/utils.cpp Sat Nov 15 21:42:16 2014 +0000
+++ b/utils.cpp Wed Nov 26 22:53:15 2014 +0000
@@ -7,3 +7,17 @@
{
return ghettoFloor(d + 0.5);
}
+
+float xpadNormalizeAnalog(int x){
+ float res = 0;
+ if(x > 0){
+ res = (float)x/32767.0;
+ }else{
+ res = (float)x/32768.0;
+ }
+ return res;
+}
+float xpadNormalizeTrigger(int x){
+ float res = (float)x / (float)0xff;
+ return res;
+}
