TT

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gert_lauritsen
Date:
Wed Jul 27 21:49:03 2016 +0000
Commit message:
Fortl?big fungerende

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 Jul 27 21:49:03 2016 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+
+DigitalOut statusled(p22);
+DigitalOut TxLed(p21);
+Serial Radio(p9,p10);
+//Serial Radio(USBTX,USBRX);
+
+AnalogIn transmitter(p15);
+AnalogIn amb(p16);
+AnalogIn midt(p17);
+AnalogIn oltemp(p18);
+
+float AmbiantTemp2;
+float MidtTemp; //2
+float BeerTemp2;
+float PumpeEnde; //2
+float SlangeEnde;
+
+void ReadData() {
+ float data[4];
+ AmbiantTemp2=(amb.read()*3.3-0.25)/0.028;   
+ MidtTemp=(midt.read()*3.3-0.25)/0.028;   
+ BeerTemp2=(oltemp.read()*3.3-0.25)/0.028;   
+ SlangeEnde=(transmitter.read()*3.3-0.597)*4,16;   
+ Radio.printf("%f %f %f %f\r\n",AmbiantTemp2,MidtTemp,BeerTemp2,SlangeEnde);
+ TxLed=!TxLed;
+}    
+
+int main() {
+    char ch;
+    statusled=1;
+    while(1) {
+        if (Radio.readable()) {
+           ch=Radio.getc();
+           if (ch==0x21) ReadData();
+        }    
+    }    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 27 21:49:03 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file