455445

Dependencies:   MMA8451Q TSI USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
prtkmynk
Date:
Sun Apr 02 06:43:44 2017 +0000
Commit message:
23;

Changed in this revision

MMA8451Q.lib Show annotated file Show diff for this revision Revisions of this file
TSI.lib Show annotated file Show diff for this revision Revisions of this file
USBdevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 45e5fa042d68 MMA8451Q.lib
--- /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
diff -r 000000000000 -r 45e5fa042d68 TSI.lib
--- /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
diff -r 000000000000 -r 45e5fa042d68 USBdevice.lib
--- /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
diff -r 000000000000 -r 45e5fa042d68 main.cpp
--- /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
diff -r 000000000000 -r 45e5fa042d68 mbed.bld
--- /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