kadai3

Dependencies:   mbed TextLCD

Files at this revision

API Documentation at this revision

Comitter:
shunsaku000
Date:
Wed Aug 03 08:08:53 2022 +0000
Commit message:
pressuresensor;

Changed in this revision

TextLCD.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r bf12b5254bf3 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Aug 03 08:08:53 2022 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r bf12b5254bf3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 03 08:08:53 2022 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+
+TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
+AnalogIn ain(p15);
+
+int main() {
+    float adc, volts, N;
+    
+    while (1){
+        lcd.locate(0,0);
+        adc = ain.read();           // read analog as a float
+        volts = adc ;          // convert to volts
+        N = volts * 16 ;    
+        lcd.printf("%8.3f N\n", N);
+
+        wait(0.05);                 // 20Hz update rate
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r bf12b5254bf3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Aug 03 08:08:53 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file