Liam Grazier
/
0NicksCoursework-lg
diajzifsajoifajsoifaj
Fork of ELEC350-CWTEMPLATE-2017 by
main.cpp
- Committer:
- liam_grazier
- Date:
- 2018-01-05
- Revision:
- 5:9b4844128e09
- Parent:
- 3:a88838ff33e7
- Child:
- 6:f0601ebd2423
File content as of revision 5:9b4844128e09:
#include "components.hpp" #include "SDBlockDevice.h" #include "FATFileSystem.h" //#include "Networkbits.hpp" #include "mbed.h" #include "lglcd.h" #include "stdio.h" // This is a very short demo that demonstrates all the hardware used in the coursework. // You will need a network connection set up (covered elsewhere). The host PC should have the address 10.0.0.1 //Threads Thread nwrkThread; int main(){ lglcd mylcd(D7,D6,D5,D4,D3,D2); mylcd.clear(); while(true){ double temp = sensor.getTemperature(); double pressure = sensor.getPressure(); char TEM[6]; char PRE[5]; sprintf(TEM,"%.2f", temp); sprintf(PRE,"%.2f", pressure); printf(TEM); printf(PRE); mylcd.clear(); mylcd.write("Pre: "); mylcd.write(PRE); wait(0.5); mylcd.clear(); mylcd.write("Temp: "); mylcd.write(TEM); wait(0.5); } //Flash to indicate goodness }