Ben Gordon
/
ELEC351_GroupA-branch1
Troubleshooting
Display.cpp@13:d49ec153d644, 2018-11-08 (annotated)
- Committer:
- BenRJG
- Date:
- Thu Nov 08 22:39:14 2018 +0000
- Revision:
- 13:d49ec153d644
- Parent:
- 12:edf31d0a61f0
- Child:
- 15:f8649829dff9
Replace mbed with mbed-os (Thread wasn't included)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
BenRJG | 11:c561293919d9 | 1 | #include "Display.hpp" |
BenRJG | 11:c561293919d9 | 2 | |
BenRJG | 11:c561293919d9 | 3 | void Display::INIT() |
BenRJG | 11:c561293919d9 | 4 | { |
BenRJG | 13:d49ec153d644 | 5 | _lcd.INIT(); |
BenRJG | 12:edf31d0a61f0 | 6 | setTemperature(0); |
BenRJG | 12:edf31d0a61f0 | 7 | setLightLevel(0); |
BenRJG | 12:edf31d0a61f0 | 8 | setPressure(0); |
BenRJG | 13:d49ec153d644 | 9 | |
BenRJG | 13:d49ec153d644 | 10 | pageOne(); |
BenRJG | 12:edf31d0a61f0 | 11 | } |
BenRJG | 12:edf31d0a61f0 | 12 | |
BenRJG | 12:edf31d0a61f0 | 13 | void Display::pageOne() |
BenRJG | 12:edf31d0a61f0 | 14 | { |
BenRJG | 13:d49ec153d644 | 15 | _lcd.clear(); |
BenRJG | 13:d49ec153d644 | 16 | |
BenRJG | 13:d49ec153d644 | 17 | //Temperature Display |
BenRJG | 13:d49ec153d644 | 18 | _lcd.display("T: "); |
BenRJG | 13:d49ec153d644 | 19 | _lcd.display(_temperature); |
BenRJG | 13:d49ec153d644 | 20 | _lcd.putt(223); |
BenRJG | 13:d49ec153d644 | 21 | _lcd.display("C"); |
BenRJG | 13:d49ec153d644 | 22 | |
BenRJG | 13:d49ec153d644 | 23 | //LightLevel Display |
BenRJG | 13:d49ec153d644 | 24 | _lcd.display("L: ",LINE1+9); |
BenRJG | 13:d49ec153d644 | 25 | _lcd.display(_lightLevel); |
BenRJG | 12:edf31d0a61f0 | 26 | |
BenRJG | 13:d49ec153d644 | 27 | //Pressure Display |
BenRJG | 13:d49ec153d644 | 28 | _lcd.display("P: ",LINE2+2); |
BenRJG | 13:d49ec153d644 | 29 | _lcd.display(_pressure); |
BenRJG | 13:d49ec153d644 | 30 | _lcd.display(" mbar"); |
BenRJG | 12:edf31d0a61f0 | 31 | } |
BenRJG | 12:edf31d0a61f0 | 32 | |
BenRJG | 12:edf31d0a61f0 | 33 | void Display::pageTwo() |
BenRJG | 12:edf31d0a61f0 | 34 | { |
BenRJG | 13:d49ec153d644 | 35 | _lcd.clear(); |
BenRJG | 13:d49ec153d644 | 36 | _lcd.display("dd/mm/yyyy",LINE1+3); |
BenRJG | 13:d49ec153d644 | 37 | _lcd.display("hh:mm am",LINE2+4); |
BenRJG | 12:edf31d0a61f0 | 38 | } |
BenRJG | 12:edf31d0a61f0 | 39 | |
BenRJG | 12:edf31d0a61f0 | 40 | void Display::setTemperature(S_BYTE temp) |
BenRJG | 12:edf31d0a61f0 | 41 | { |
BenRJG | 12:edf31d0a61f0 | 42 | sprintf(_temperature,"%d",temp); |
BenRJG | 12:edf31d0a61f0 | 43 | } |
BenRJG | 12:edf31d0a61f0 | 44 | |
BenRJG | 12:edf31d0a61f0 | 45 | void Display::setLightLevel(U_BYTE light) |
BenRJG | 12:edf31d0a61f0 | 46 | { |
BenRJG | 12:edf31d0a61f0 | 47 | sprintf(_lightLevel,"%u",light); |
BenRJG | 12:edf31d0a61f0 | 48 | } |
BenRJG | 12:edf31d0a61f0 | 49 | |
BenRJG | 12:edf31d0a61f0 | 50 | void Display::setPressure(U_BYTE pres) |
BenRJG | 12:edf31d0a61f0 | 51 | { |
BenRJG | 12:edf31d0a61f0 | 52 | sprintf(_pressure,"%u",pres); |
BenRJG | 11:c561293919d9 | 53 | } |
BenRJG | 11:c561293919d9 | 54 | |
BenRJG | 11:c561293919d9 | 55 | void Display::clear() |
BenRJG | 11:c561293919d9 | 56 | { |
BenRJG | 12:edf31d0a61f0 | 57 | |
BenRJG | 11:c561293919d9 | 58 | } |