USB HID Mouse demo for NXP Freedom Development Platform. Move automatically the mouse cursor circularly on the computer screen

Dependencies:   USBDevice mbed

Revision:
0:004692590ee7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 31 17:03:42 2015 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "USBMouse.h"
+#include <math.h>
+
+USBMouse mouse(ABS_MOUSE);
+
+  int main(void)
+  {
+    uint16_t x_center = (X_MAX_ABS - X_MIN_ABS)/2;
+    uint16_t y_center = (Y_MAX_ABS - Y_MIN_ABS)/2;
+    uint16_t x_screen = 0;
+    uint16_t y_screen = 0;
+    
+    uint32_t x_origin = x_center;
+    uint32_t y_origin = y_center;
+    uint32_t radius = 5000;
+    uint32_t angle = 0;
+ 
+    while (1)
+    {
+        x_screen = x_origin + cos((double)angle*3.14/180.0)*radius;
+        y_screen = y_origin + sin((double)angle*3.14/180.0)*radius;
+        
+        mouse.move(x_screen, y_screen);
+        angle += 3;
+        wait(0.01);
+    }
+  }
\ No newline at end of file