
aaa
Fork of 0NicksCoursework-lg by
Revision 6:f0601ebd2423, committed 2018-01-05
- Comitter:
- liam_grazier
- Date:
- Fri Jan 05 17:56:59 2018 +0000
- Parent:
- 5:9b4844128e09
- Child:
- 7:dd303488e55d
- Commit message:
- working screen
Changed in this revision
LGLCD.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LGLCD.lib Fri Jan 05 14:13:43 2018 +0000 +++ b/LGLCD.lib Fri Jan 05 17:56:59 2018 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/liam_grazier/code/LGLCD/#ef052de2d7d0 +https://os.mbed.com/users/liam_grazier/code/LGLCDv2/#9020af47a312
--- a/main.cpp Fri Jan 05 14:13:43 2018 +0000 +++ b/main.cpp Fri Jan 05 17:56:59 2018 +0000 @@ -15,21 +15,61 @@ mylcd.clear(); while(true){ double temp = sensor.getTemperature(); -double pressure = sensor.getPressure(); +double pressure = sensor.getPressure(); +double lightin = adcIn; char TEM[6]; char PRE[5]; sprintf(TEM,"%.2f", temp); sprintf(PRE,"%.2f", pressure); printf(TEM); printf(PRE); -mylcd.clear(); -mylcd.write("Pre: "); +mylcd.setline(1,1); +mylcd.write("P:"); mylcd.write(PRE); -wait(0.5); -mylcd.clear(); -mylcd.write("Temp: "); +mylcd.setline(1,10); +mylcd.write("T:"); mylcd.write(TEM); -wait(0.5); +mylcd.setline(2,1); +mylcd.write("L:"); +if(lightin > 0.8 && lightin < 0.9) +{ +mylcd.setline(2,4); +mylcd.write(" "); +mylcd.setline(2,4); + mylcd.write("|||||||||"); +} +else if(lightin > 0.51 && lightin < 0.9) +{ + mylcd.setline(2,4); +mylcd.write(" "); +mylcd.setline(2,4); + mylcd.write("|||||"); +} +else if(lightin > 0.4 && lightin < 0.5) +{ + mylcd.setline(2,4); +mylcd.write(" "); +mylcd.setline(2,4); + mylcd.write("|||"); +} +else if(lightin > 0.2 && lightin < 0.39) +{ + mylcd.setline(2,4); +mylcd.write(" "); +mylcd.setline(2,4); + mylcd.write("LOW"); +} +else if(lightin < 0.19) +{ +mylcd.setline(2,4); +mylcd.write(" "); +mylcd.setline(2,4); +mylcd.write("disconnected"); +} + +//mylcd.write(light); +//printf(adcIn); +wait(0.4); }