If/when it is pressed measure the time between the two presses and act accordingly. Save the time it was pressed and start looking for the second one to be pressed. It is considerably easier to program this if you make one of the buttons the master and look for that being pressed first. Here’s the code I have so far: const int LeftButtonPin = 2 // Left palm button attached to pin 2Ĭonst int RightButtonPin = 3 // Right palm button attached to pin 3Ĭonst int StartRelay = 13 //cycle start relay attached to pin 13ĭigitalWrite (StartRelay, HIGH) //energize start relayĭelay (1000) //delay for process to finishĭigitalWrite (StartRelay, LOW) //turn off start relay
My mechanical engineer brain doesn’t see logic the same way as a programmer’s brain. The rest of the IO stuff is pretty straightforward but this 2 hand anti-tiedown has me stumped.
LADDER LOGIC PROGRAM REPEAT HOW TO
I’ve attached the ladder logic I’ve used to program a PLC, I’m just not sure how to put this logic into a format that an arduino can understand. Ideally the buttons would have to be held throughout the entire cycle or else the process is interrupted. If you’re unfamiliar with a 2 hand anti tie down, the operator has to press 2 buttons at the same time (typically a tolerance of 500ms is given since humans can’t press two buttons at exactly the same time) and hold the buttons throughout the cycle, then the buttons have to both be released before the cycle can be restarted. Before I get chastized for using software for a safety control, understand that the process will not injure the operator, but the operator could interfere with the process quality if their hands were in the wrong place at the right time. I need a 2 hand anti tie down to start the cycle.
I’m working on a project using an arduino instead of an expensive PLC or industrial timer relays.