Skip to main content

Reply to "Make-and-break circuit with adjustable duration, controlled by a foot switch?"

Wow Stan, that's amazing.  I'm not an EE and I've never built anything like this.  Is the white substrate called a "breadboard?"

In order to better describe the problem I started to depict a signal trace for the primary and secondary circuits showing the "on" and "off" in each as a square pulse from 0 to 1.  This got me thinking about the "resolution" of the system, i.e., minimum duration and re-trigger holdoff, etc.  It inspired this basic-like program which describes the logic/behavior I'm trying to achieve.

0010 REM A and B are variables representing the state of the footswitch.  Can be boolean or integer.

0020 REM there should also be global variables for the polling interval, relay open, and relay closed times.  Omitted for clarity.

0100 A = Poll(footswitch) : REM return value is either 0 or 1. Default state is closed so initially A=1

1000 REM ** Main routine **

1100 Wait 0.1 seconds : REM this time may need to be adjusted

1110 B = Poll(footswitch) : REM poll the footswitch again and store result in a different variable "B" the same type as "A"

1120 IF B=A THEN 1100 : REM no change detected in the state of the footswitch, so don't do anything with the relay.  Wait a little and poll again.

1200 REM Subroutine ** State of the footswitch has changed **

1210 A=B : REM update the stored reference variable with the "new" state of the footswitch

1220 Open the relay : REM relay is normally closed

1230 Wait 0.1 seconds : REM Keep it open for exactly 0.1 seconds to permit recognition by the target device.  (This time may need to be adjusted.)

1240 Close the Relay

1245 Wait 0.1 seconds: REM minimum time to keep the relay closed to permit acknowledgement by the target device (may need to be adjusted)

1250 GOTO 1110 : REM back to main routine- poll the footswitch again etc.

2000 END : REM note there is no exit from the loops and no returned value(s)

Obviously this is neither BASIC nor pseudocode, and I have no way to test the logic.  I'm just trying to describe to all of you what I want to happen.  Thanks for helping me puzzle through this!

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×