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 00004 //create mouse object 00005 USBMouse mouse; 00006 00007 int main() 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 //will cause mouse to move in a circle 00016 x = cos((double)angle * 3.14 / 180.0) * radius; 00017 y = sin((double)angle * 3.14 / 180.0) * radius; 00018 00019 //will move mouse x, y away from its previous position on the screen 00020 mouse.move(x, y); 00021 angle += 3; 00022 //ThisThread::sleep_for(10); 00023 } 00024 }
Generated on Thu Jul 14 2022 17:03:34 by
1.7.2