ANIS RASHID
/
analog_input
CUBALAH TEKA
Revision 0:7bd35ef84f5a, committed 2018-05-17
- Comitter:
- ANIS_RASHID
- Date:
- Thu May 17 08:17:55 2018 +0000
- Commit message:
- Langit tak selalunya cerah;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Thu May 17 08:17:55 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 17 08:17:55 2018 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD lcd(D8, D9, D4, D5, D6, D7); +Serial pc (USBTX, USBRX); +AnalogIn Ain (PC_3); +float ADCdata; + +int main() { +lcd.printf ("LDR ="); + while(1) + { + ADCdata=Ain; + ADCdata=ADCdata*100; + lcd.locate (4,1); + lcd.printf ("%f",ADCdata); + pc.printf ("%f\n\r",ADCdata); + wait (0.5); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 17 08:17:55 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file