The project is not done yet
Dependencies: USBHost USBHostXpad mbed-rtos mbed
Fork of Totaleprogramma by
utils.cpp
- Committer:
- juliandekker
- Date:
- 2015-03-02
- Revision:
- 1:da390b3b1330
- Parent:
- 0:345f76c72b9a
File content as of revision 1:da390b3b1330:
#include "utils.h" double ghettoFloor(double d){ return double((long long)d); } double round(double d) { 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; }