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:45e5fa042d68, committed 2017-04-02
- Comitter:
- prtkmynk
- Date:
- Sun Apr 02 06:43:44 2017 +0000
- Commit message:
- 23;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA8451Q.lib Sun Apr 02 06:43:44 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 06:43:44 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 06:43:44 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 06:43:44 2017 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "MMA8451Q.h"
+#include "TSISensor.h"
+#include "USBMouse.h"
+#define address (0X1d<<1)
+
+MMA8451Q acc(PTE25,PTE24,address);
+TSISensor TSI;
+USBMouse mouse;
+
+float xaxis,yaxis,zaxis;
+main()
+{
+ float click=0;
+ float x=0;
+ float y=0;
+
+ while(1)
+ {
+ x=-5.5*acc.getAccY();
+ y=5.5*acc.getAccX();
+
+ mouse.move(x,y);
+
+ click=100*TSI.readPercentage();
+ if (click>0)
+ {
+ if(click<=40)
+ {
+ mouse.press(MOUSE_RIGHT);
+ }
+ else if(click>=60)
+ {
+ mouse.press(MOUSE_LEFT);
+ }
+ }
+ else
+ {
+ mouse.release(MOUSE_RIGHT);
+ mouse.release(MOUSE_LEFT);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Apr 02 06:43:44 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab \ No newline at end of file