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.
Revision 0:004692590ee7, committed 2015-12-31
- Comitter:
- GregC
- Date:
- Thu Dec 31 17:03:42 2015 +0000
- Commit message:
- USB HID Mouse demo for NXP Freedom Development Platform. Move automatically the mouse cursor circularly on the computer screen
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Thu Dec 31 17:03:42 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/USBDevice/#5b7d31d9d3f3
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Dec 31 17:03:42 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file