bandymas

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
pinout
Date:
Wed Feb 27 20:10:38 2019 +0000
Commit message:
test

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Feb 27 20:10:38 2019 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+
+
+AnalogIn analog_value(A0);
+
+AnalogIn analog_value1(A1);
+
+DigitalOut led(LED1);
+
+int main()
+{
+    
+    // PT1000
+    float meas_r;
+    float meas_v;
+    
+    // Termopora
+    float meas_r1;
+    float meas_v1;
+    
+    printf("\nAnalogIn example\n");
+
+    while(1) {
+
+        // TERMOPORA
+        meas_r1 = analog_value.read(); // Read the analog input value (value from 0.0 to 1.0 = full ADC conversion range)
+        //meas_v1 = ((meas_r1 * 3300) / 100) * 0.41; // Converts value in the 0V-3.3V range. matuojama itampa reikia dalinti is 100 (gain) ir paskui padauginti is 0.41uV/C.
+        meas_v1 = meas_r1 * 3300; // Converts value in the 0V-3.3V range. matuojama itampa reikia dalinti is 100 (gain) ir paskui padauginti is 0.41uV/C.
+
+        // PT1000
+        meas_r = analog_value1.read(); // Read the analog input value (value from 0.0 to 1.0 = full ADC conversion range)
+        meas_v = meas_r * 3300; // Converts value in the 0V-3.3V range
+        
+        
+        // Display values
+       // printf("pt1000 = %f = %.0f mV \n\r", meas_r, meas_v);
+        //printf("termopora = %f = %.0f C \n", meas_r1, fTemp);
+        printf("termopora = %f = %.0f C \n\r", meas_r1, meas_v1);
+
+        wait(0.2); // 0.5 second
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Feb 27 20:10:38 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file