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: MMA8451Q SLCD mbed
Diff: main.cpp
- Revision:
- 1:2f3874d539dd
- Parent:
- 0:236e405a257c
diff -r 236e405a257c -r 2f3874d539dd main.cpp
--- a/main.cpp Wed Jan 27 16:37:46 2016 +0000
+++ b/main.cpp Wed Jan 27 16:46:05 2016 +0000
@@ -21,7 +21,7 @@
#define MMA8451_I2C_ADDRESS (0x1d<<1)
// Display
-SLCD slcd;
+SLCD lcd;
// Anzahl Schritte
long step = 0;
// letzte Z Lage
@@ -29,13 +29,12 @@
// Schwellenwerte
float min = -0.2;
float max = 0.2;
-// I/O Buffer
-char buf[5];
+
int main(void)
{
MMA8451Q acc(SDA, SCL, MMA8451_I2C_ADDRESS);
- slcd.clear();
+ lcd.clear();
printf("MMA8451 ID: %d\n", acc.getWhoAmI());
@@ -51,8 +50,8 @@
if ( z > max && last < min )
step++;
- slcd.Home();
- slcd.printf( "%4d", step );
+ lcd.Home();
+ lcd.printf( "%4d", step );
last = z;
}
}