That is a rare event that shouldn't have a lot of money sunk into, though it could cause a ricochet if cylinder is still in contact while plate is hit with subsonic pellet. If it becomes an issue, I'd suggest adding piezo sensors for feedback and a scoring system/"shoot/no-shoot" display system to work around it. Range rules should be set up to not shoot target until 1 second after reset, or run one 'stage', let them reset, etc. It's up to the designer to decide how to run the range.After target lifts, it can be hit within a few 1/10 sec., so lifter needs to out of the way quickly. Might use a moveable pin, withdrawn by a solenoid untill target falls??-- ? How fast does spring return cyl. retract?
#picaxe20M2
; More info at:http://forum.allaboutcircuits.com/showthread.php?t=77919
;
; This code may be re-used, modified, and shared by anybody, as long as the information and credits above are not altered or removed.
; Please post improved code ideas and updates to a thread in the electronics chat area of allaboutcircuits.com
; Have fun, remember to wear eye and hearing protection when shooting!
;declarations
dirsB=$FF ; All port B pins to outputs (20M2 pins 11-18)
dirsC=$0F ; first 4 ports of port C as outputs (20M2 pins 7-10)
pinsB = %00000000 ; Reset all port B Pins to 0
pinsC=$00 ; Reset all port C outputs to 0
;variables
symbol delaytime = w0 ;delaytime variable random requires word variables
symbol outs = b10 ; outputs
symbol adjust = b11 ; Potentiometer connected to C.7 (20M2 pin 3) to adjust delays
;initialization
delaytime = $1F ;seed pseudo-random generator
;main loop
main:
readadc c.7,adjust ; Pot connected between V+ and Gnd, wiper connected to C.7 (20M2 pin 3). Used for adjusting random timing.
adjust = adjust * 100 ; make 0-254 number 0-25400
random delaytime ; get pseudo-random number between 0 and 65535
delaytime = delaytime % 7000 ; Mod 7000 to get number between 0 and 7000
;delaytime = delaytime + 3000 ;add 3000 for 3-10second delaytime (depreciated by user potentiometer addition)
delaytime = delaytime + adjust ; add user chosen delaytime to delay.
pause delaytime ;pause for 0-26,100 milliseconds (0-26 seconds, user set potentiometer + 0-7 seconds)
random delaytime ; get new random number for output states
outs = delaytime/256 ;use first 8 bits of delaytime word for random port b outputs
pinsB= outs ;set portB pins high or low psuedo-random (20M2 pins 11-18)
random delaytime ; get new random number for output states
outs = delaytime/512 ;use last 4 bits of delaytime word for random port c outputs
pinsC= outs ;set portC pins high or low psuedo-random (20M2 pins 7-10)
pause 500 ;wait ½ second to ensure all chosen targets to reset are up
pinsB = $00 ;disable outputs after the ½ second delay so cylinders aren't pushing on target
pinsC = $00 ;disable outputs after the ½ second delay so cylinders aren't pushing on target
goto main ; keep doing it until power is removed.
by Jake Hertz
by Jake Hertz
by Aaron Carman
by Aaron Carman