lab question 2

Dependencies:   mbed C12832_lcd MMA7660 ttmath

Files at this revision

API Documentation at this revision

Comitter:
niallmoyvane
Date:
Tue May 21 11:54:31 2019 +0000
Commit message:
lab question 2

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
MMA7660.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
ttmath.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7cd973be7a0a C12832_lcd.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/dreschpe/code/C12832_lcd/#8f86576007d6
diff -r 000000000000 -r 7cd973be7a0a MMA7660.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA7660.lib	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/MMA7660/#36a163511e34
diff -r 000000000000 -r 7cd973be7a0a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "MMA7660.h"
+
+Serial pc(USBTX,USBRX);
+MMA7660 MMA(p28, p27);
+
+
+float calculateAngle(float x, float y, float z)
+        {
+            float angle = 0;
+            angle= (atan(x/sqrt((y*y)+(z*z))))*180.0/ 3.14159265;
+            return angle;
+            
+        }
+         int main()
+            {
+                while (1)
+                {
+                    pc.printf("x%f, y%f, z%f, ang%f\n\r",MMA.x(),MMA.y(),MMA.z(),calculateAngle(MMA.x(),MMA.y(),MMA.z()));
+                    wait(1);
+                }
+            }
+                
\ No newline at end of file
diff -r 000000000000 -r 7cd973be7a0a mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/armmbed/mbed-os/#0063e5de32fc575f061244c96ac60c41c07bd2e6
diff -r 000000000000 -r 7cd973be7a0a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
diff -r 000000000000 -r 7cd973be7a0a ttmath.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ttmath.lib	Tue May 21 11:54:31 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/stevep/code/ttmath/#04a9f72bbca7