Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "USBMouse.h" 00003 #include <math.h> 00004 00005 USBMouse mouse(ABS_MOUSE); 00006 00007 int main(void) 00008 { 00009 uint16_t x_center = (X_MAX_ABS - X_MIN_ABS)/2; 00010 uint16_t y_center = (Y_MAX_ABS - Y_MIN_ABS)/2; 00011 uint16_t x_screen = 0; 00012 uint16_t y_screen = 0; 00013 00014 uint32_t x_origin = x_center; 00015 uint32_t y_origin = y_center; 00016 uint32_t radius = 5000; 00017 uint32_t angle = 0; 00018 00019 while (1) 00020 { 00021 x_screen = x_origin + cos((double)angle*3.14/180.0)*radius; 00022 y_screen = y_origin + sin((double)angle*3.14/180.0)*radius; 00023 00024 mouse.move(x_screen, y_screen); 00025 angle += 3; 00026 wait(0.01); 00027 } 00028 }
Generated on Tue Aug 2 2022 22:03:46 by
1.7.2