Ben Gordon
/
ELEC351_GroupA_alternate
temp
Pages.cpp
- Committer:
- BenRJG
- Date:
- 2018-12-06
- Revision:
- 0:2a4af0cb6e8d
File content as of revision 0:2a4af0cb6e8d:
#include "Pages.hpp" //d.setTime(); //printf("Info Start -------\n\r"); //printf("Time -> %s\n\r",d.getTime()); //printf("Info End ---------\n\r"); void Pages::INIT() { setTemperature(0); setLightLevel(0); setPressure(0); _lcd.INIT(); } void Pages::pageOne() { _lcd.clear(); // _lcd.disableCursor(); //Temperature Page _lcd.display("T: ",LINE1); _lcd.display(_temperature); _lcd.putt(223); _lcd.display("C"); //LightLevel Page _lcd.display("L: ",LINE1+9); _lcd.display(_lightLevel); //Pressure Page _lcd.display("P: ",LINE2+2); _lcd.display(_pressure); _lcd.display(" mbar"); _lcd.enableCursor(); } void Pages::pageTwo() { _lcd.clear(); // _lcd.enableCursor(); _lcd.display("00/00/0000 00:00",LINE1); _lcd.display("dd/mm/yyyy hh:mm",LINE2); _lcd.pos(LINE1); } void Pages::pageThree() { _lcd.clear(); // _lcd.enableCursor(); _lcd.display("Life? don't talk",LINE1); _lcd.display("to me about life",LINE2); _lcd.pos(LINE1); } void Pages::setTemperature(S_BYTE temp) { sprintf(_temperature,"%d",temp); } void Pages::setLightLevel(U_BYTE light) { sprintf(_lightLevel,"%u",light); } void Pages::setPressure(U_BYTE pres) { sprintf(_pressure,"%u",pres); } void Pages::setDateTime(char* dateTime) { _lcd.pos(LINE1); _lcd.display(dateTime,LINE1); } void Pages::cursorPos(UINT_16 location) { _lcd.pos(location); } void Pages::clear() { }