Jagdip Manhota / Mbed 2 deprecated MMA7660Accel

Dependencies:   C12832_lcd mbed

Fork of MMA7660 by Erik -

Revision:
3:9d2894e17d59
--- /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