Hi Im a very green newbie and Ive just started trying to do programming so bear with me. I have a good understanding of hardware but the programming is a whole new world that I havent quite got the hang of yet.
Im using an 08m to trigger three transitors that in turn control three relays. I have a Push to make button as a trigger and I need it to do as follows:
STEP 1
Press button
debounce the button
output0 goes hi
STEP 2
press button a second time
debounce the button
output0 stays hi and output1 goes hi
STEP 3
press and HOLD the button a third time
output0 turns off output1 stays hi and output2 goes hi
as soon as the button is released output1 goes hi output1 stays hi and output2 turns off
STEP 4
press the button
debounce the button
all pins turn off
Also if you hold the button for longer than 2 seconds during Steps 1 or 2, I want the program to automatically start Step 3.
Additionally if you press the button twice within 1 second (double click) during steps 1 or 2 I want it to turn off as well.
Now being a newbie this program is hurting my head trying to figure it out and I was hoping maybe someone could help me out with this cause Im going nowhere fast. Other than code for debouncing the button I dont know what else to cut and paste in order to get this going.
Im using an 08m to trigger three transitors that in turn control three relays. I have a Push to make button as a trigger and I need it to do as follows:
STEP 1
Press button
debounce the button
output0 goes hi
STEP 2
press button a second time
debounce the button
output0 stays hi and output1 goes hi
STEP 3
press and HOLD the button a third time
output0 turns off output1 stays hi and output2 goes hi
as soon as the button is released output1 goes hi output1 stays hi and output2 turns off
STEP 4
press the button
debounce the button
all pins turn off
Also if you hold the button for longer than 2 seconds during Steps 1 or 2, I want the program to automatically start Step 3.
Additionally if you press the button twice within 1 second (double click) during steps 1 or 2 I want it to turn off as well.
Now being a newbie this program is hurting my head trying to figure it out and I was hoping maybe someone could help me out with this cause Im going nowhere fast. Other than code for debouncing the button I dont know what else to cut and paste in order to get this going.
Last edited: