
I was not able to print without a colon. I tried to use the class info on Colon() class and set up a boolean to turn off the colon. I couldn't get it print.
Fork of kl46z_btn_slider_toSerial by
Revision 8:018b01e6b807, committed 2017-01-22
- Comitter:
- menchacaeli
- Date:
- Sun Jan 22 23:37:06 2017 +0000
- Parent:
- 7:8f64ad5334ca
- Commit message:
- Attempted to make the program print with no colon. I used the classes information Colon() to print without a colon.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8f64ad5334ca -r 018b01e6b807 main.cpp --- a/main.cpp Mon Oct 12 03:19:22 2015 +0000 +++ b/main.cpp Sun Jan 22 23:37:06 2017 +0000 @@ -13,6 +13,8 @@ #define DATATIME 200 //milliseconds #define LCDLEN 10 #define PROGNAME "kl46z_btn_slider_toSerial\r\n" +#define COLOFF 0 // setting boolean to turn off colon +#define COLON 1 // setting boolean to turn on colon // Cap slider interface SLCD slcd; //define LCD display @@ -24,7 +26,9 @@ InterruptIn rtButton(RBUT); InterruptIn lfButton(LBUT); -char lcdData[LCDLEN]; +//char lcdData[LCDLEN]; + +char noColData[LCDLEN]; Serial pc(USBTX, USBRX);// set up USB as communications to Host PC via USB connectons @@ -43,18 +47,25 @@ void LCDMessNoDwell(char *lMess){ slcd.Home(); slcd.clear(); + //using line below to turn off or on colon + slcd.Colon(COLOFF); slcd.printf(lMess); } // -------------------------------- int main() { float sliderValue = 0.0; - + //int sliderValue = 0; + pc.printf(PROGNAME); dataTimer.start(); - dataTimer.reset(); - sprintf (lcdData,"%4.3f",0.0); - LCDMessNoDwell(lcdData); + dataTimer.reset(); + + //sprintf (lcdData,"%4.3f",0.0); + //LCDMessNoDwell(lcdData); + + sprintf (noColData,"%4.3f", 0.0); + LCDMessNoDwell(noColData); // Interrupt routine setups rtButton.fall(&rtButtonPressed); @@ -71,9 +82,11 @@ // Only do stuff with it if it's a new value or if it's not zero if(newSliderValue > 0.0 && newSliderValue != sliderValue) { sliderValue = newSliderValue; - sprintf (lcdData,"%4.3f", sliderValue); // Just to make things user readable + //sprintf (lcdData,"%4.3f", sliderValue); // Just to make things user readable + sprintf (noColData, "%4.3f", sliderValue); - LCDMessNoDwell(lcdData); + //LCDMessNoDwell(noColData); + LCDMessNoDwell(noColData); pc.printf("slider: %4.3f\r\n", sliderValue); } dataTimer.reset();