irrigation system for the ST Nucleo boards

Dependencies:   mbed

Revision:
4:9e223db481da
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/steps.cpp	Sat Apr 18 21:06:58 2015 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+#include "steps.h"
+#include "LCDs.h"
+#include "Decoder.h"
+
+steps::steps(){}
+
+int steps::step1(int v)
+{
+    LCDs c;
+    Decoder d;
+    if(v==11){
+        c.lcdcmd(0x01);
+        c.putString("1-> AUTOMATIC   2-> MANUAL");
+        return(1);
+    }
+    
+    else if(v==21){        
+        char disp[16];
+        int temp = d.checkIn();
+        sprintf(disp,"%d",temp*5);        
+        c.lcdcmd(0x01);
+        c.putString("temperature: ");
+        c.lcdcmd(0xC0);
+        c.putString(disp);
+        c.putString(" C");   
+        return(2);     
+    }
+    
+    else if(v==31){
+        char disp2[16];
+        int temp2 = d.checkIn();
+        sprintf(disp2,"%d",temp2*8);        
+        c.lcdcmd(0x01);
+        c.putString("Soil Moisture: ");
+        c.lcdcmd(0xC0);
+        c.putString(disp2);
+        c.putString(" %");
+        return(3);
+    }
+    else
+    {
+        return(0);
+    }
+}
+
+void steps::automatic(int v2)
+{
+    
+}
+
+void steps::manual(int v2)
+{
+    
+}
\ No newline at end of file