USBMouse Hello World (beta)
Revision 0:1f891541da9e, committed 2011-11-02
- Comitter:
- simon
- Date:
- Wed Nov 02 18:56:08 2011 +0000
- Commit message:
Changed in this revision
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 |
diff -r 000000000000 -r 1f891541da9e USBDevice.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Wed Nov 02 18:56:08 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/samux/code/USBDevice/#900e0c78cfd2
diff -r 000000000000 -r 1f891541da9e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Nov 02 18:56:08 2011 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "USBMouse.h" + +USBMouse mouse; + +int main() { + int16_t x = 0; + int16_t y = 0; + int32_t radius = 10; + int32_t angle = 0; + + while (1) { + x = cos((double)angle*3.14/180.0)*radius; + y = sin((double)angle*3.14/180.0)*radius; + mouse.move(x, y); + angle += 3; + wait(0.001); + } +} \ No newline at end of file