Group B accelerometer code

Dependencies:   C12832_lcd mbed

Fork of MMA7660 by Erik -

Files at this revision

API Documentation at this revision

Comitter:
MrBushido
Date:
Fri May 09 18:47:52 2014 +0000
Parent:
2:a8e20db7901e
Commit message:
group B code accelerometer

Changed in this revision

C12832_lcd.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Fri May 09 18:47:52 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#8f86576007d6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Main.cpp	Fri May 09 18:47:52 2014 +0000
@@ -0,0 +1,25 @@
+//Uses the measured z-acceleration to drive leds 2 and 3 of the mbed
+ #include "C12832_lcd.h"
+#include "mbed.h"
+#include "MMA7660.h"
+ 
+MMA7660 MMA(p28, p27);
+C12832_LCD lcd;
+ float ax, ay, az ;
+DigitalOut connectionLed(LED1);
+PwmOut Zaxis_p(LED2);
+PwmOut Zaxis_n(LED3);
+ 
+int main() {  
+    if (MMA.testConnection())
+        connectionLed = 1;
+        
+    while(1) {
+    // Accelerometer code
+    wait(1);
+            ax=MMA.x(); // read accelerometer values 
+            ay=MMA.y(); 
+            az=MMA.z(); 
+            lcd.locate(1,11);
+            lcd.printf("MMA: %.4f %.4f %.4f",ax,ay,az);
+            }}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 09 18:47:52 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file