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: MMA8451Q TSI USBDevice mbed
Revision 0:96da48543320, committed 2017-04-02
- Comitter:
- RITVIK_DAVE
- Date:
- Sun Apr 02 09:19:59 2017 +0000
- Commit message:
- Yes
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA8451Q.lib Sun Apr 02 09:19:59 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/emilmont/code/MMA8451Q/#c4d879a39775
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TSI.lib Sun Apr 02 09:19:59 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/mbed/code/TSI/#1a60ef257879
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Sun Apr 02 09:19:59 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/mbed_official/code/USBDevice/#01321bd6ff89
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Apr 02 09:19:59 2017 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "USBMouse.h"
+#include "MMA8451Q.h"
+#include "TSISensor.h"
+Serial PC(USBTX,USBRX);
+USBMouse mouse;
+TSISensor tsi;
+MMA8451Q acc(PTE25,PTE24,0x1d<<1);
+int main()
+{ float click=0,x=0,y=0,sensitivity=15;
+char Input;
+ while(1){
+ PC.printf("To adjust sensitivity \n\r 's'--> slow \n\r 'm'--> medium \n\r 'f'-->fast\r");
+ if (PC.readable())
+ {
+ Input=PC.getc();
+ if(Input=='s')
+ sensitivity = 8;
+ else if(Input=='m')
+ sensitivity = 18;
+ else if(Input=='f')
+ sensitivity = 25;
+ }
+ x=sensitivity*acc.getAccY();
+ y=sensitivity*acc.getAccX();
+ mouse.move(-x,y);
+ click=tsi.readPercentage();
+ if (click>0.6 && click<=1)
+ mouse.press(MOUSE_LEFT);
+ else if (click>0 && click<=0.4)
+ {mouse.press(MOUSE_RIGHT);
+ }
+ else
+ { mouse.release(MOUSE_LEFT);
+ mouse.release(MOUSE_RIGHT);}
+ wait(0.001);
+ }
+}
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Apr 02 09:19:59 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/856d2700e60b \ No newline at end of file