Hisyam Sulaiman
/
ptnom3
g
Revision 0:9988b63235b3, committed 2018-05-24
- Comitter:
- HisyamSulaiman
- Date:
- Thu May 24 04:17:28 2018 +0000
- Commit message:
- huhu
Changed in this revision
diff -r 000000000000 -r 9988b63235b3 TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Thu May 24 04:17:28 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 9988b63235b3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 24 04:17:28 2018 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD lcd(D8, D9, D4, D5, D6, D7); +DigitalIn button(PA_12); +Serial pc(USBTX, USBRX); +AnalogIn Ain(PC_3); +float ADCdata; + +int main() { + +lcd.locate (1,0); +lcd.printf("Celsius"); + + + while(1) { + if (button==0){ + ADCdata=Ain; + ADCdata=ADCdata*100; + lcd.locate (4,1); + lcd.printf("%f",ADCdata); + pc.printf("%f\n\r",ADCdata); + wait(0.5);} + else (button==1){ + ADCdata=Ain; + ADCdata=ADCdata*100; + lcd.locate (12,1); + lcd.printf("%f",ADCdata); + pc.printf("%f\n\r",ADCdata); + wait(0.5);} + } +}
diff -r 000000000000 -r 9988b63235b3 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 24 04:17:28 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file