Program for the water play project for the course Software Testing Practical 2016 given at the VU University
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
Diff: LCDController.cpp
- Revision:
- 17:17ea1372f64a
- Parent:
- 10:fd4670ec0806
- Child:
- 18:da84737ee427
--- a/LCDController.cpp Mon Jun 13 09:19:19 2016 +0000 +++ b/LCDController.cpp Mon Jun 13 09:49:37 2016 +0000 @@ -21,7 +21,19 @@ void LCDController::updateScreen(float displaytemp, float saltvolt) { lcd.cls(); - lcd.printf("Temp: %.1fC\nSalt: %.3fPPT",displaytemp,saltvolt); + + char tempbuffer[16]; + + if (displaytemp > 100) + { + sprintf(tempbuffer, "Temp: NC"); + } else { + sprintf(tempbuffer,"Temp: %.1fC",displaytemp); + } + + + + lcd.printf("%s\nSalt: %.3fPPT",tempbuffer,saltvolt); } void LCDController::updateScreen(float distance) {