Isme 5 x 5 ka grid plot hota h screen me, USBmouse use karke. As soon as you connect the board to PC via HID
Fork of USBMouse_HelloWorld by
main.cpp@5:c7ea2e0e773f, 2016-07-06 (annotated)
- Committer:
- akashlal
- Date:
- Wed Jul 06 12:51:27 2016 +0000
- Revision:
- 5:c7ea2e0e773f
- Parent:
- 3:b8caa902d79e
na
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 2:e7b766501add | 1 | #include "mbed.h" |
samux | 2:e7b766501add | 2 | #include "USBMouse.h" |
samux | 2:e7b766501add | 3 | USBMouse mouse; |
samux | 2:e7b766501add | 4 | int main() { |
samux | 2:e7b766501add | 5 | int16_t x = 0; |
samux | 2:e7b766501add | 6 | int16_t y = 0; |
akashlal | 5:c7ea2e0e773f | 7 | int point = 5; |
akashlal | 5:c7ea2e0e773f | 8 | int scale = 40; |
akashlal | 5:c7ea2e0e773f | 9 | int i; |
akashlal | 5:c7ea2e0e773f | 10 | int j=0; |
akashlal | 5:c7ea2e0e773f | 11 | |
akashlal | 5:c7ea2e0e773f | 12 | for(i=1;i<=point;i++) |
akashlal | 5:c7ea2e0e773f | 13 | { |
akashlal | 5:c7ea2e0e773f | 14 | if(j==0) |
akashlal | 5:c7ea2e0e773f | 15 | { |
akashlal | 5:c7ea2e0e773f | 16 | mouse.click(MOUSE_LEFT); |
akashlal | 5:c7ea2e0e773f | 17 | mouse.release(MOUSE_LEFT); |
akashlal | 5:c7ea2e0e773f | 18 | mouse.move(20,0); |
akashlal | 5:c7ea2e0e773f | 19 | } |
akashlal | 5:c7ea2e0e773f | 20 | for(j=1;j<=point;j++) |
akashlal | 5:c7ea2e0e773f | 21 | { |
akashlal | 5:c7ea2e0e773f | 22 | mouse.click(MOUSE_LEFT); |
akashlal | 5:c7ea2e0e773f | 23 | mouse.release(MOUSE_LEFT); |
akashlal | 5:c7ea2e0e773f | 24 | x=scale; |
akashlal | 5:c7ea2e0e773f | 25 | y=0; |
akashlal | 5:c7ea2e0e773f | 26 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 27 | wait(0.5); |
akashlal | 5:c7ea2e0e773f | 28 | } |
akashlal | 5:c7ea2e0e773f | 29 | x = 0; |
akashlal | 5:c7ea2e0e773f | 30 | y = scale; |
akashlal | 5:c7ea2e0e773f | 31 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 32 | x= -(scale); |
akashlal | 5:c7ea2e0e773f | 33 | y=0; |
akashlal | 5:c7ea2e0e773f | 34 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 35 | x= -(scale); |
akashlal | 5:c7ea2e0e773f | 36 | y=0; |
akashlal | 5:c7ea2e0e773f | 37 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 38 | x= -(scale); |
akashlal | 5:c7ea2e0e773f | 39 | y=0; |
akashlal | 5:c7ea2e0e773f | 40 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 41 | x= -(scale); |
akashlal | 5:c7ea2e0e773f | 42 | y=0; |
akashlal | 5:c7ea2e0e773f | 43 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 44 | x= -(scale); |
akashlal | 5:c7ea2e0e773f | 45 | y=0; |
akashlal | 5:c7ea2e0e773f | 46 | mouse.move(x, y); |
akashlal | 5:c7ea2e0e773f | 47 | j=1; |
akashlal | 5:c7ea2e0e773f | 48 | } |
samux | 0:48fd0c31cef5 | 49 | } |