Skovbrynet / Mbed 2 deprecated DHT2_NY_TEST

Dependencies:   mbed

Fork of Solar by Skovbrynet

Files at this revision

API Documentation at this revision

Comitter:
gert_lauritsen
Date:
Wed Feb 17 22:09:53 2016 +0000
Child:
1:87df5ce85ede
Commit message:
; This demo will read the Voltage and Current from the "AttoPilot Voltage and Current Sense Board,"; convert the raw ADC data to Volts and Amps and display them as floating point numbers on the; Serial Enabled LCD. (If you would like to do without the S

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 17 22:09:53 2016 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+RawSerial pc(USBTX, USBRX);
+AnalogIn   Ain1(p19);// --- AttoPilot "V"
+AnalogIn   Ain2(p20);// --- AttoPilot "I"
+
+int VRaw; //This will store our raw ADC data
+int IRaw;
+float VFinal; //This will store the converted data
+float IFinal;
+
+int main()
+{
+    while(1) {
+        VRaw = Ain1.read_u16();
+        IRaw = Ain2.read_u16();
+
+        //Conversion
+        VFinal = VRaw/49.44; //45 Amp board
+        //VFinal = VRaw/12.99; //90 Amp board
+        //VFinal = VRaw/12.99; //180 Amp board
+
+        IFinal = IRaw/14.9; //45 Amp board
+        //IFinal = IRaw/7.4; //90 Amp board
+        //IFinal = IRaw/3.7; //180 Amp board
+        pc.printf("%.1   Volts\r\n",VFinal);
+        pc.printf("%.1f   Amps\r\n\r\n\r\n",IFinal);
+        wait(0.2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Feb 17 22:09:53 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file