Referred coursework template 2019

Dependencies:   X_NUCLEO_IKS01A3 USBDevice

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Fri Jul 19 13:56:50 2019 +0000
Parent:
4:44bf486fd3cf
Commit message:
Updated for 2019 Referral;

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 44bf486fd3cf -r 9a6db486eca9 USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Fri Jul 19 13:56:50 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/USBDevice/#53949e6131f6
diff -r 44bf486fd3cf -r 9a6db486eca9 main.cpp
--- a/main.cpp	Mon Jun 03 09:58:27 2019 +0000
+++ b/main.cpp	Fri Jul 19 13:56:50 2019 +0000
@@ -39,6 +39,7 @@
 /* Includes */
 #include "mbed.h"
 #include "XNucleoIKS01A3.h"
+#include "USBMouse.h"
 
 /* Instantiate the expansion board */
 static XNucleoIKS01A3 *mems_expansion_board = XNucleoIKS01A3::instance(D14, D15, D4, D5, A3, D6, A4);
@@ -87,6 +88,8 @@
   return str;
 }
 
+USBMouse mouse;
+
 /* Simple main function */
 int main() {
   uint8_t id;
@@ -94,6 +97,11 @@
   char buffer1[32], buffer2[32];
   int32_t axes[3];
   
+    int16_t x = 0;
+    int16_t y = 0;
+    int32_t radius = 10;
+    int32_t angle = 0;
+  
   /* Enable all sensors */
   hum_temp->enable();
   press_temp->enable();
@@ -146,6 +154,12 @@
     acc_gyro->get_g_axes(axes);
     printf("LSM6DSO [gyro/mdps]:   %6d, %6d, %6d\r\n", axes[0], axes[1], axes[2]);
 
-    wait(1.5);
+    x = cos((double)angle*3.14/180.0)*radius;
+    y = sin((double)angle*3.14/180.0)*radius;
+
+    //will move mouse x, y away from its previous position on the screen
+    mouse.move(x, y);
+    angle += 3;
+    wait(0.001);
   }
 }
diff -r 44bf486fd3cf -r 9a6db486eca9 mbed-os.lib
--- a/mbed-os.lib	Mon Jun 03 09:58:27 2019 +0000
+++ b/mbed-os.lib	Fri Jul 19 13:56:50 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/armmbed/mbed-os/#73f096399b4cda1f780b140c87afad9446047432
+https://github.com/armmbed/mbed-os/#5941d1718339116cd12914238ec331c84da3d08f