Chris Styles
/
DemoBoard_USB_Mouse
Diff: main.cpp
- Revision:
- 0:89d3ef1a9362
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Sep 19 07:47:37 2009 +0000 @@ -0,0 +1,22 @@ +#include "DemoBoard.h" + +/* + * This project uses the USB interface configured as a mouse, using the HID device class + * Thw X,Y pots give the mouse control, and the buttons are the mouse buttons + */ + +int main() { + + while(1) { + + // read the pots, use them to offset and scale the X,Y values + float mx = ((potx.read()-0.50f) * 100.0f); + float my = ((poty.read()-0.54f) * 130.0f); + + // Call the mouse function with the X,Y and button status + hid.mouse(mx, -my, RedButton.read()); + } + +} + +