ADC

Dependents:   GloboMetereologico

Files at this revision

API Documentation at this revision

Comitter:
DanielOlarte
Date:
Sat Nov 19 18:57:58 2016 +0000
Commit message:
ADC

Changed in this revision

ADC.cpp Show annotated file Show diff for this revision Revisions of this file
ADC.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 969bd4f60e3f ADC.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADC.cpp	Sat Nov 19 18:57:58 2016 +0000
@@ -0,0 +1,12 @@
+#include "ADC.h"
+
+double adc::adcx(PinName Sen)
+{
+    _Sen=Sen;
+    double ent;
+    AnalogIn lec1(_Sen);
+    ent = lec1.read_u16();
+    wait(0.05);
+    ent = ent * 0.000050354;
+    return ent;
+}
diff -r 000000000000 -r 969bd4f60e3f ADC.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADC.h	Sat Nov 19 18:57:58 2016 +0000
@@ -0,0 +1,20 @@
+#ifndef MBED_ADC
+#define MBED_ADC_H
+
+#include "mbed.h"
+
+using namespace mbed;
+
+class adc
+
+{
+public:
+
+    double adcx(PinName Sen);
+
+private:
+
+    PinName _Sen;
+};
+
+#endif
\ No newline at end of file