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: TextLCD mbed MMA8451Q TSI
Diff: MyLCD.cpp
- Branch:
- mono
- Revision:
- 12:47ba147bcbb7
- Parent:
- 11:97e964c9eeb2
- Child:
- 15:b358e700d2d7
diff -r 97e964c9eeb2 -r 47ba147bcbb7 MyLCD.cpp
--- a/MyLCD.cpp Sun Oct 18 21:44:06 2015 +0000
+++ b/MyLCD.cpp Mon Oct 19 10:11:19 2015 +0000
@@ -7,9 +7,6 @@
{
public:
MyLCD(int refreshRate, PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7): lcd(rs, e, d4, d5, d6, d7) {
- lcd.printf("%d Hz, %.3f s", refreshRate, 1.0/refreshRate);
- wait(3);
- i=0;
if (refreshRate>0)
t.attach(this, &MyLCD::update, 1.0/refreshRate);
else
@@ -19,14 +16,14 @@
void printf(string text) {
strcpy (buffer,text.c_str());
}
- void printf(string text, float number) {
- const char *tmp2 = text.append(": %.1f").c_str();
- sprintf(buffer, tmp2, number);
+
+ void printf(string text, float number, string nav) {
+ const char *tmp2 = text.append(": %.1f\n%s").c_str();
+ sprintf(buffer, tmp2, number, nav);
}
private:
TextLCD lcd;
- int i;
Ticker t;
char buffer[33], bufferOld [33];
