Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832 MMA7660 mbed
Fork of app-shield-accelerometer by
Revision 6:244758de2362, committed 2015-11-02
- Comitter:
- rtk
- Date:
- Mon Nov 02 15:07:03 2015 +0000
- Parent:
- 5:636ebfdf373b
- Commit message:
- DS;
Changed in this revision
diff -r 636ebfdf373b -r 244758de2362 MMA7660.lib --- a/MMA7660.lib Thu Feb 06 17:00:28 2014 +0000 +++ b/MMA7660.lib Mon Nov 02 15:07:03 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Sissors/code/MMA7660/#a8e20db7901e +http://mbed.org/users/Sissors/code/MMA7660/#36a163511e34
diff -r 636ebfdf373b -r 244758de2362 main.cpp
--- a/main.cpp Thu Feb 06 17:00:28 2014 +0000
+++ b/main.cpp Mon Nov 02 15:07:03 2015 +0000
@@ -4,17 +4,23 @@
// Using Arduino pin notation
C12832 lcd(D11, D13, D12, D7, D10);
-MMA7660 MMA(SDA,SCL);
+MMA7660 MMA(I2C_SDA,I2C_SCL);
+enum Orientation {Up, Down,
+ Right, Left,
+ Back, Front,
+ Unknown
+ };
int main()
{
- lcd.cls();
- lcd.locate(0,3);
- lcd.printf("mbed application shield!");
+
while(1) {
- lcd.locate(0,14);
- lcd.printf("x=%.2f y=%.2f z=%.2f",MMA.x(), MMA.y(), MMA.z());
+ lcd.locate(0,0);
+ if (MMA.getSide()==Front) {
+ lcd.cls(); // pour ne pas avoir Desssus écrit sur Dessous
+ lcd.printf("Dessus");
+ } else if (MMA.getSide()==Back) lcd.printf("Dessous");
wait(0.2);
}
}
diff -r 636ebfdf373b -r 244758de2362 mbed.bld --- a/mbed.bld Thu Feb 06 17:00:28 2014 +0000 +++ b/mbed.bld Mon Nov 02 15:07:03 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file
