Terryn Fredrickson
/
Mouse_Test
This is a test program to check keil download
main.cpp@0:f3d57cbb6b99, 2014-08-04 (annotated)
- Committer:
- Terryn
- Date:
- Mon Aug 04 19:52:22 2014 +0000
- Revision:
- 0:f3d57cbb6b99
test program for keil download
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Terryn | 0:f3d57cbb6b99 | 1 | #include "mbed.h" |
Terryn | 0:f3d57cbb6b99 | 2 | #include "USBMouse.h" |
Terryn | 0:f3d57cbb6b99 | 3 | |
Terryn | 0:f3d57cbb6b99 | 4 | USBMouse mouse; |
Terryn | 0:f3d57cbb6b99 | 5 | |
Terryn | 0:f3d57cbb6b99 | 6 | int main() |
Terryn | 0:f3d57cbb6b99 | 7 | { |
Terryn | 0:f3d57cbb6b99 | 8 | int16_t x = 0; |
Terryn | 0:f3d57cbb6b99 | 9 | int16_t y = 0; |
Terryn | 0:f3d57cbb6b99 | 10 | int32_t radius = 10; |
Terryn | 0:f3d57cbb6b99 | 11 | int32_t angle = 0; |
Terryn | 0:f3d57cbb6b99 | 12 | |
Terryn | 0:f3d57cbb6b99 | 13 | while(1) |
Terryn | 0:f3d57cbb6b99 | 14 | { |
Terryn | 0:f3d57cbb6b99 | 15 | x = cos((double)angle*3.14/180.0)*radius; |
Terryn | 0:f3d57cbb6b99 | 16 | y = sin((double)angle*3.14/180.0)*radius; |
Terryn | 0:f3d57cbb6b99 | 17 | |
Terryn | 0:f3d57cbb6b99 | 18 | mouse.move(x, y); |
Terryn | 0:f3d57cbb6b99 | 19 | angle +=3; |
Terryn | 0:f3d57cbb6b99 | 20 | wait(.001); |
Terryn | 0:f3d57cbb6b99 | 21 | } |
Terryn | 0:f3d57cbb6b99 | 22 | } |