make public

Dependencies:   mbed C12832_lcd MMA7660

Files at this revision

API Documentation at this revision

Comitter:
BertieHarte
Date:
Fri Mar 26 10:18:32 2021 +0000
Commit message:
make public

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.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7daab31a41c6 C12832_lcd.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Fri Mar 26 10:18:32 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/dreschpe/code/C12832_lcd/#8f86576007d6
diff -r 000000000000 -r 7daab31a41c6 MMA7660.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA7660.lib	Fri Mar 26 10:18:32 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/MMA7660/#36a163511e34
diff -r 000000000000 -r 7daab31a41c6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Mar 26 10:18:32 2021 +0000
@@ -0,0 +1,27 @@
+//Uses x & y acceleration to simulate a bubble level
+//on the application board LCD display
+#include "mbed.h"
+#include "MMA7660.h"
+#include "C12832_lcd.h"
+ 
+C12832_LCD lcd; //On board LCD display
+MMA7660 MMA(p28, p27); //I2C Accelerometer
+DigitalOut connectionLed(LED1);//Accel OK LED
+ 
+int main()
+{
+    int x=0,y=0;
+    lcd.cls(); //clear LCD screen
+    if (MMA.testConnection())
+        connectionLed = 1; //Accelerometer init OK
+    while(1) {
+        //read X,Y +/-Gs and scale for #display pixels
+        x = (x + MMA.x() * 32.0)/2.0;
+        y = (y -(MMA.y() * 16.0))/2.0;
+        lcd.fillcircle(x+63, y+15, 3, 1); //draw bubble
+        lcd.circle(63, 15, 8, 1);
+        wait(.1); //time delay
+        lcd.fillcircle(x+63, y+15, 3, 0); //erase bubble
+    }
+ 
+}
diff -r 000000000000 -r 7daab31a41c6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 26 10:18:32 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file