LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Header.cpp@7:11675c1dce4f, 2015-06-03 (annotated)
- Committer:
- ovidiup13
- Date:
- Wed Jun 03 12:22:46 2015 +0000
- Revision:
- 7:11675c1dce4f
- Parent:
- 4:024e6a9c2ebf
updated header, cleaned up menu, fixed controls for device
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ovidiup13 | 0:1e597b0f8b3b | 1 | #include "Header.h" |
ovidiup13 | 0:1e597b0f8b3b | 2 | |
ovidiup13 | 7:11675c1dce4f | 3 | Header::Header(char * t, ST7565 * lcd){ |
ovidiup13 | 7:11675c1dce4f | 4 | //battery_level = lvl; |
ovidiup13 | 2:fcde41900fa5 | 5 | title = t; |
ovidiup13 | 0:1e597b0f8b3b | 6 | st7565 = lcd; |
ovidiup13 | 0:1e597b0f8b3b | 7 | } |
ovidiup13 | 0:1e597b0f8b3b | 8 | |
ovidiup13 | 4:024e6a9c2ebf | 9 | void Header::setTitle(char *t){ |
ovidiup13 | 4:024e6a9c2ebf | 10 | title = t; |
ovidiup13 | 4:024e6a9c2ebf | 11 | } |
ovidiup13 | 4:024e6a9c2ebf | 12 | |
ovidiup13 | 0:1e597b0f8b3b | 13 | void Header::display(void){ |
ovidiup13 | 0:1e597b0f8b3b | 14 | //create strings |
ovidiup13 | 2:fcde41900fa5 | 15 | //char temp[7]; |
ovidiup13 | 7:11675c1dce4f | 16 | //char level[5]; |
ovidiup13 | 2:fcde41900fa5 | 17 | //char sign = ' '; |
ovidiup13 | 0:1e597b0f8b3b | 18 | //set sign |
ovidiup13 | 2:fcde41900fa5 | 19 | //if(temp > 0) sign = 43; |
ovidiup13 | 2:fcde41900fa5 | 20 | //else if(temp < 0) sign = 45; |
ovidiup13 | 0:1e597b0f8b3b | 21 | |
ovidiup13 | 0:1e597b0f8b3b | 22 | //strcat(temp, sign); |
ovidiup13 | 0:1e597b0f8b3b | 23 | |
ovidiup13 | 0:1e597b0f8b3b | 24 | //convert to char array |
ovidiup13 | 2:fcde41900fa5 | 25 | //sprintf(temp, " %c%.1f%c", sign, degrees, scale); |
ovidiup13 | 7:11675c1dce4f | 26 | //sprintf(level, "%d%%", battery_level); |
ovidiup13 | 0:1e597b0f8b3b | 27 | |
ovidiup13 | 0:1e597b0f8b3b | 28 | //add to header |
ovidiup13 | 2:fcde41900fa5 | 29 | st7565->drawstring(LEFT_MARGIN*5, 0, title); |
ovidiup13 | 7:11675c1dce4f | 30 | //st7565->drawstring(LCDWIDTH - LEFT_MARGIN*4, 0, level); |
ovidiup13 | 0:1e597b0f8b3b | 31 | |
ovidiup13 | 0:1e597b0f8b3b | 32 | st7565->display(); |
ovidiup13 | 0:1e597b0f8b3b | 33 | } |