Jump to content

onn

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About onn

  • Rank
    Newbrie
  1. Hope got ppl can help me..i stuck on this step so long ready still dun know fix it.. Question 1. Stop input At any time of the wash cycle, means at any state. When you press the stop button, the wash motor and spin are ‘off’ but pump is in ‘on’ state. At this state you must sense the water level. When the water level reach the lower level sensor, pump off. This state is the original state (idle state). my problem is on state 4 when the wash cycle is turn on then will automatic delay 10s for wash cycle process.after that it will go to state 5..but now i want change it to during delay 10s.. if i click stop button then it will go to state 9... unfortunately now my program is during delay 10s if i click stop button it wont go to state 9 its keep continue to state 5... 7 6 5 4 3 2 1 0 STOP temperature(0) SENSOR(low) SENSOR(low) temperature(1) START port A LED WATER CYCLE WATER HEATER SPIN PUMP port B Below there is my code for state 4,5 and 9 void state0(void){ inbyte=porta; portb=0x00; //no output inbyte &=0x01; if (inbyte==0x01) nxtstate=1; //if click start then go to state 1 }//end of state0. void state4(void){ inbyte=porta; portb=0x10; //turned on wash cycle inbyte &=0x80; if (portb==0x10){ //if turned on wash cycle delay(1,1000); //DELAY 10s nxtstate=5; //after finish delay go state 5 if(inbyte==0x80) nxtstate=9; //if press sp(stop) and go to state 9 } }//end of state4 void state5(void){ inbyte=porta; portb = 0x01; //turn on PUMP inbyte &=0x88 ; if (inbyte==0x08)nxtstate=6; //if click SENSOR (low) then go state 6 if (inbyte==0x80) nxtstate=9; //if press sp(stop) and go to state 9 }//end of state5 void state9(void){ portb = 0x01; //turn on PUMP inbyte=porta; inbyte &=0x08; if (inbyte==0x08)nxtstate=0 ; //if SENSOR (low) then go to state 0 }//end of state9
×
×
  • Create New...