Just mouse test for x,y position

Dependencies:   mbed Mouse

main.cpp

Committer:
joshwilkins2013
Date:
2015-03-31
Revision:
2:ed0782fc9b00
Parent:
1:afd3fc7c27a2

File content as of revision 2:ed0782fc9b00:

#include "mbed.h"
#include "Mouse.h"

Serial pc(USBTX, USBRX);

MOUSE mouse;

signed long mx, my;
float dx, dy;

int main(){
    pc.baud(9600);
    mouse.init();
    while(1){
        mx = mouse.getDx();
        my = mouse.getDy();
        dx = mx;
        dy = my;
                
        pc.printf("x = ");
        pc.printf("%f\t", dx);
        pc.printf("y = ");
        pc.printf("%f\n", dy);
    }
}