Norimasa Okamoto / Mbed 2 deprecated F042K6_USBDevice_example

Dependencies:   F042K6_USBDevice mbed

Fork of L152RE_USBDevice_example by Norimasa Okamoto

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main_mouse.cpp Source File

main_mouse.cpp

00001 #if 1
00002 // https://developer.mbed.org/handbook/USBMouse
00003 #include "mbed.h"
00004 #include "USBMouse.h"
00005 
00006 int main() {
00007     USBMouse mouse;
00008 
00009     int16_t x = 0;
00010     int16_t y = 0;
00011     int32_t radius = 10;
00012     int32_t angle = 0;
00013 
00014     while (1) {
00015         x = cos((double)angle*3.14/180.0)*radius;
00016         y = sin((double)angle*3.14/180.0)*radius;
00017         
00018         mouse.move(x, y);
00019         angle += 3;
00020         wait(0.005);
00021     }
00022 }
00023 
00024 #endif