Example program with the C12832 display and MMA7660 I2C accelerometer of the mbed application shield.
Dependencies: C12832 MMA7660 mbed
Revision 0:cc9d7d4dfb99, committed 2014-04-01
- Comitter:
- screamer
- Date:
- Tue Apr 01 16:27:40 2014 +0000
- Child:
- 1:bad592d14bea
- Commit message:
- Initial revision
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Tue Apr 01 16:27:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/components/code/C12832/#1c3011afe95d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Tue Apr 01 16:27:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/components/code/MMA7660/#a8e20db7901e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Apr 01 16:27:40 2014 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "C12832.h"
+#include "MMA7660.h"
+
+C12832 lcd(D11, D13, D12, D7, D10);
+MMA7660 MMA(D14, D15);
+
+int main()
+{
+ // clear the screen
+ lcd.cls();
+
+ // print the first line and wait 3 sec
+
+ lcd.locate(0,3);
+
+ if (!MMA.testConnection()) {
+ lcd.printf("failed to initialize!");
+ } else {
+ lcd.printf("mbed application board!");
+ }
+ wait(3);
+
+ // print the counter prefix; the number will be printed in the while loop
+
+ int i=1;
+ while(i++) {
+ lcd.locate(0,15);
+ lcd.printf("%f, %f ", MMA.x(), MMA.y());
+ wait(0.2);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 01 16:27:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7d30d6019079 \ No newline at end of file