sheldon holmes / Mbed 2 deprecated Lciis

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers steps.cpp Source File

steps.cpp

00001 #include "mbed.h"
00002 #include "steps.h"
00003 #include "LCDs.h"
00004 #include "Decoder.h"
00005 
00006 steps::steps(){}
00007 
00008 int steps::step1(int v)
00009 {
00010     LCDs c;
00011     Decoder d;
00012     if(v==11){
00013         c.lcdcmd(0x01);
00014         c.putString("1-> AUTOMATIC   2-> MANUAL");
00015         return(1);
00016     }
00017     
00018     else if(v==21){        
00019         char disp[16];
00020         int temp = d.checkIn();
00021         sprintf(disp,"%d",temp*5);        
00022         c.lcdcmd(0x01);
00023         c.putString("temperature: ");
00024         c.lcdcmd(0xC0);
00025         c.putString(disp);
00026         c.putString(" C");   
00027         return(2);     
00028     }
00029     
00030     else if(v==31){
00031         char disp2[16];
00032         int temp2 = d.checkIn();
00033         sprintf(disp2,"%d",temp2*8);        
00034         c.lcdcmd(0x01);
00035         c.putString("Soil Moisture: ");
00036         c.lcdcmd(0xC0);
00037         c.putString(disp2);
00038         c.putString(" %");
00039         return(3);
00040     }
00041     else
00042     {
00043         return(0);
00044     }
00045 }
00046 
00047 void steps::automatic(int v2)
00048 {
00049     
00050 }
00051 
00052 void steps::manual(int v2)
00053 {
00054     
00055 }