Posted 21 November 2012 - 11:56 AM
I feel shamed to do this, since Im basically asking you to make a script for me, but I have no earlier experience in coding.
Im building this thingy with 4 directional moving arm, which I would like to use with computer. The script would consist of only 4 repeating commands, each telling how to move to specific direction, like:
rs.setBundledOutput ("top", colors.red) –sends signal to motor
rs.setBundledOutput ("top", 0) –stops the signal
sleep(3) –waits for the arm to catch up
and then repeat it until the arm would have moved enough to one direction. Distances the arm moves are pretty big, so I really wouldt care for typing that scrip in there so many times. Ive undestood that with functions, I could do it somewhat like this:
function = ArmForward
rs.setBundledOutput ("top", colors.red)
rs.setBundledOutput ("top", 0)
sleep(3)
end
then my code would be like:
ArmForward
ArmForward
ArmForward
ArmLeft
etc…
Now, can somebody please explain how to do this in practically. I know, im a terrible person
Im building this thingy with 4 directional moving arm, which I would like to use with computer. The script would consist of only 4 repeating commands, each telling how to move to specific direction, like:
rs.setBundledOutput ("top", colors.red) –sends signal to motor
rs.setBundledOutput ("top", 0) –stops the signal
sleep(3) –waits for the arm to catch up
and then repeat it until the arm would have moved enough to one direction. Distances the arm moves are pretty big, so I really wouldt care for typing that scrip in there so many times. Ive undestood that with functions, I could do it somewhat like this:
function = ArmForward
rs.setBundledOutput ("top", colors.red)
rs.setBundledOutput ("top", 0)
sleep(3)
end
then my code would be like:
ArmForward
ArmForward
ArmForward
ArmLeft
etc…
Now, can somebody please explain how to do this in practically. I know, im a terrible person