Need some help with control flow for clothes dryer


hello all,
my dryer broke down couple of days ago, , rather try source new touch panel, though perhaps make new control system arduino. smart!

it's kenmore elite gas dryer 2000s, used electronic touch panel controls.

i opened , have been successful getting motor spin , fire on/off. great! comes fun part: coding!

i made beer brewing robot before, figured dawdle. it's not. :(

i'm using dht11 sense temperature , moisture. i've got lcd panel buttons i'm not using yet because can't figure out how make menus work. but, that's not big problem. big problem i'm having trouble figuring out control flow.

here's image of i'm trying do:
control flow dryer.001 nearlynormal007, on flickr

my problem never goes "run mode", , i'm not sure why.

i've been until 2am past 3 nights working on it, , i'd make progress, @ least run automatic temperature , time, before wife gets home tomorrow (so smart! :d )


code: [select]

 if (buttonprevious == low && reading == high && currentmode == "stop_mode") {
    //currentmode = "run_mode";
    run_mode();
  }
  else if (buttonprevious == high && reading == low && currentmode != "stop_mode") {
    //currentmode = "stop_mode";
    stop_mode();
  }


look here.  assuming button reads high when pressed?  right?  doesn't matter, if not invert logic in i'm say.

so button low , high , we're in stop mode go run mode.  great.  release button.  once release button , loop repeats, buttonprevious high, current reading button low, , not in stop mode.  did tell in situation?  best can hope there in run_mode few microseconds.

also, notice use of strings keep mode.  that's incredibly clunky.  have @ enum in c++.  lets set list of words stand numbers.  it's perfect thing keeping states or modes.  save ton of headache down road. 





Arduino Forum > Using Arduino > Programming Questions > Need some help with control flow for clothes dryer


arduino

Comments