Hi,
I hope you can help. I’m coming to the end of a rather complicated build and have hit a brick wall with the Script side of things.
The part I am trying to get working is a Tank Sponson. Yeah I know, why am I building a Tank?! Because I happen to like them!
The effect I am close but failing to achieve, is for the gun to traverse through a sequence and when the sound unit sends a signal to the servo controller, a gun recoil and flash sequence happens. Then it carries on traversing. It would have been easier possibly if there was an option for a random traverse motion, but I understand from what I have read that this is not an easy option with this setup.
Anyhow, good news is I got all the hardware to work and talk to one another, phew! Basically it was a case of buy bit, scratch head when it didn’t work, look at Forum… purchase the missing parts.
I may have played with my first computer in the 80s, but I’m not to proud to admit this has all been a learning curve for me. Challenging the mind and getting something to work still gives me a buzz.
The Parts I am using is as follows…
Pololu RC switch with Small Low-Side MOSFET. (This converts the signal from the Sound Unit to something the Servo Controller can understand.)
Six-channel Micro Maestro Servo Controller. (This is the main unit into which the rc switch sends its signal.)
Pololu basic relay carrier 5v. (Used to fire the Strobe Light for gun flash… which works! Yes!!)
Servos (Traverse, Recoil, Elevation, Gun Smoke.)
So far I have managed to get the Gun traversing and I can get the Sound unit to activate the Recoil sequence… but I can’t get it to do both! It is one or the other. I seemed to be close and last night everything I did just made things worse or at best made no change whatsoever.
Today I have decided to to do the sensible thing and just ask for help.
This is the last Script I tried…
# Sponson Movement LH
start:
begin
3968 5 servo
6062 4 servo
4809 3 servo
4594 1 servo
0 get_position 100 greater_than
if
recoil
0 get_position 100 less_than
if
traversing
endif endif
repeat
sub traversing
begin
3000 4594 4809 0 6062 3986 frame_1..5 # Frame 0
3000 5024 frame_1 # Frame 1
3000 5279 frame_1 # Frame 2
3000 4750 frame_1 # Frame 3
3000 5122 frame_1 # Frame 4
3000 5984 frame_1 # Frame 5
3000 5279 frame_1 # Frame 6
3000 5690 frame_1 # Frame 7
3000 5103 frame_1 # Frame 8
3000 4555 frame_1 # Frame 9
3000 4437 8000 frame_4_5 # Frame 10
3000 5886 3968 frame_4_5 # Frame 11
repeat
sub frame_1..5
5 servo
4 servo
3 servo
2 servo
1 servo
delay
return
sub frame_1
1 servo
delay
return
sub frame_4_5
5 servo
4 servo
delay
return
sub recoil
8000 5 servo
4680 4 servo
6368 3 servo
0 1 servo
100 delay
goto start
Helen x
This is the model actually running last weekend … https://www.facebook.com/673233936126477/videos/845596288890240/?fref=nf