analog data of trim pot, read and display
Revision 0:9fed7af3234d, committed 2020-02-12
- Comitter:
- rdverma
- Date:
- Wed Feb 12 11:13:39 2020 +0000
- Commit message:
- for FRDM-KL25Z ARM Mbed Board
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Wed Feb 12 11:13:39 2020 +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/mbed.bld Wed Feb 12 11:13:39 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pot.cpp Wed Feb 12 11:13:39 2020 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+//FVP for lcd. rs,en,d4-d7, type of lcd
+TextLCD lcd(PTA1, PTA2, PTD4, PTA12, PTA4, PTA5, TextLCD::LCD16x2);
+
+// Serial pc(USBTX, USBRX);
+AnalogIn Ain(PTB0);
+float ADCdata;
+int main()
+{
+ while (1) {
+ ADCdata=Ain*1023;
+ pc.printf("ADC Data Values... \n\r");
+ pc.printf("%.2f \n\r",ADCdata);
+ wait (0.5);
+
+ lcd.locate(1,0); //col,row
+ lcd.printf("analoge value");
+ lcd.locate(2,1); //col,row
+ lcd.printf("%.2f \n\r",ADCdata);
+ wait(0.5);
+ lcd.cls(); //clear lcd
+ }
+}