USB Mouse (relative) example for mbed NXP LPC11U24 beta
Diff: main.cpp
- Revision:
- 0:163560051396
- Child:
- 1:e089be2a6aa1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 24 10:26:27 2011 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "USBMouse.h" +#include <math.h> + +USBMouse mouse; + +int main(void) { + + 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); + } +} + +