Part 3

Dependencies:   MMA7660 mbed

Files at this revision

API Documentation at this revision

Comitter:
sairahussain
Date:
Fri Feb 27 23:01:50 2015 +0000
Commit message:
Part 3 done!

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 f0090c987098 MMA7660.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA7660.lib	Fri Feb 27 23:01:50 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/Sissors/code/MMA7660/#36a163511e34
diff -r 000000000000 -r f0090c987098 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Feb 27 23:01:50 2015 +0000
@@ -0,0 +1,41 @@
+
+#include "mbed.h"
+#include "MMA7660.h"
+ 
+MMA7660 MMA(p28, p27);
+
+Serial pc(USBTX,USBRX);
+
+AnalogIn ain(A5);
+ 
+BusOut leds(LED1,LED2,LED3,LED4);
+ 
+int main()
+{
+    leds = 0;
+    int patternLeft = 0x3;
+    int patternRight = 0x0c;
+    int patternUp = 0x6;
+    int patternDown = 0x9;
+    while(1) {
+            
+            switch(MMA.getOrientation()){
+                case 0: //UP
+                    leds = patternUp;
+                    break;
+                case 1: //DOWN
+                    leds = patternDown;
+                    break;
+                case 2: //RIGHT
+                    leds = patternRight;
+                    break;
+                case 3: //LEFT
+                    leds = patternLeft;
+                    break;
+                default:
+                    break;
+            }
+        wait(0.1);
+    }
+}
+
diff -r 000000000000 -r f0090c987098 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 27 23:01:50 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file