Dependencies:   mbed lwip

main.cpp

Committer:
chris
Date:
2009-09-19
Revision:
0:89d3ef1a9362

File content as of revision 0:89d3ef1a9362:

#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());        
    }

}