accelerometer

Dependencies:   mbed MMA7660

Files at this revision

API Documentation at this revision

Comitter:
rudolf5020
Date:
Tue Aug 18 20:17:19 2020 +0000
Commit message:
part of question 2

Changed in this revision

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.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 045cab440776 MMA7660.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA7660.lib	Tue Aug 18 20:17:19 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/rudolf5020/code/MMA7660/#2eed18ba5f03
diff -r 000000000000 -r 045cab440776 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Aug 18 20:17:19 2020 +0000
@@ -0,0 +1,25 @@
+
+#include "mbed.h"
+#include "MMA7660.h"
+ 
+ 
+MMA7660 MMA(p28, p27);
+DigitalOut connectionLed(LED1);
+
+
+int main() { 
+
+if (MMA.testConnection()) //test if accelaretor
+connectionLed = 1;
+   
+    while(1) {
+        printf ("%f, %f, %f \r", MMA.x(), MMA.z(), MMA.x()); //read x,y,z
+        wait(1);
+              
+            }
+ 
+}
+    
+
+
+
diff -r 000000000000 -r 045cab440776 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Aug 18 20:17:19 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file