LCD implementation of our project.

Dependencies:   mbed mbed-rtos MLX90614

Committer:
ovidiup13
Date:
Wed Jun 03 17:42:47 2015 +0000
Revision:
10:97389d774ae1
Parent:
7:11675c1dce4f
working version, comment out thermo in main;

Who changed what in which revision?

UserRevisionLine numberNew 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 }