I got all the parts for my initial Target Reset Project today.

This is how it looks so far.

http://i699.photobucket.com/albums/v...ct004Large.jpg

http://i699.photobucket.com/albums/v...ct007Large.jpg

I just needed to solder one resistor on the back as shown above to make the micro switch input work, plus solder the red power link so it would work as a stand alone unit without the USB cable connected.

It has loads of potential for clever target designs. Several can also be connected to a master micro controller to form a fully automated system. I imagine with some thought you could make a system that adds up the total target falls over a preset time period or starts and stops a timing board display.


This is the Youtube video of it in operation.

http://www.youtube.com/watch?v=t-IM87imTGY

The code was reasonably simple in the end.
Just a modification of some of the worked examples supplied in the online user guide.






Here is the code to make it work. Just cut and paste it into the free Maestro control centre software and you are up and running.

# Automatic falling plate target reset control
# Wait for target plate to fall on to microswitch
# After a preset delay then move servo arm forwards to reset the plate
# Then return reset arm back to the home position
# Return to the start of the sequence

# Servo Connected to Output 0
# Microswitch connected to Input 1 via pull up resistor
# Onboard Red LED signals Microswitch activation and delay timer
# Servo speed reduced while lifting target plate to avoid bounce

# Uses WAIT_FOR_BUTTON_PRESS to allow a user to trigger a sequence
# of position events on servo 0.
begin
frame
repeat

sub frame
wait_for_button_press
led_on
4000 Delay
50 0 speed
4000 0 servo
moving_wait
led_off
0 0 speed
8000 0 servo
return


sub moving_wait
begin
get_moving_state
while
# wait until it is no longer moving
repeat
return




# Returns 1 if the button is pressed, 0 otherwise.
sub button
1 get_position 500 less_than
return



# Waits for a button press, with debouncing.
# (Requires the BUTTON subroutine.)
sub wait_for_button_press
wait_for_button_open_10ms
wait_for_button_closed_10ms
return

# wait for the button to be NOT pressed for at least 10 ms
sub wait_for_button_open_10ms
get_ms # put the current time on the stack
begin
# reset the time on the stack if it is pressed
button
if
drop get_ms
else
get_ms over minus 10 greater_than
if drop return endif
endif
repeat

# wait for the button to be pressed for at least 10 ms
sub wait_for_button_closed_10ms
get_ms
begin
# reset the time on the stack if it is pressed
button
if
get_ms over minus 10 greater_than
if drop return endif
else
drop get_ms
endif
repeat

I hope that gives people some ideas?

Thanks

Mark