I am trying to add a hit sensor to my target. I use one servo to lift then get out of the way, the shooter has 3 seconds to hit the target. If they miss it then the other servo comes up and knocks the target down. I am using a normally closed contact mounted on the base and the magnet mounted on the target. So up will give you an open an down will give you a closed. I need to input this into the Maestro and give a signal to the target software. When the target is up it should be low. When it is down it will be high. The problem is that I only want the out put to be active between when the target is lifted and when the down servo comes up to knock it down. If during that window the circuit goes high, it will be logged as a legitimate hit. Here is the code that makes 1 target work:
9000 0 servo
4000 0 servo
4000 1 servo
8000 1 servo
4000 1 servo
I know I need a subroutine that is waiting during the 3 seconds the target is up as well as checking the status of the input. If it sees the input go high during that delay then BANG, the out put sends the trigger to the scoring unit. Anything outside of that window should not trigger the output.
I am also having trouble with a command to pause a script at a designated point and then start it up again with a button press. Lets say I have 7 of these targets repeating the above sequence and I need to stop every three targets to tell everyone to reload and then hit a button when everyone is ready. I know I need something that will keep the script in a loop until the button is pressed and I have tried the code in the manual but nothing is working. I am really trying to dot homework here but I have hit a brick wall. Please help!