How do I reassign pins

Hello all.

I currently have only one Arduino installed. I am not currently using any of the torso functions so I would like to reassing those pins on the Nervo board to control the 4 servos for the right shoulder and bicep.At least I can move the right arm then.

Can someone tell me how to do this. I am an amatuer programmer at best so you may have to be specific with a chunk of code and telling me where to put it.

 

Thanks guys!

 

GroG's picture

Hello pscartozzi ! Can you

Hello pscartozzi !

Can you tell us what version you are currently using ?

Our suggestions would vary depending on version.

Cheers,

GroG

pscartozzi's picture

Using 1412 Grog  

Using 1412 Grog

 

GroG's picture

Need a link to the script

Need a link to the script your currently using or a noWorky....

Any chance of you testing the 'latest' ?

pscartozzi's picture

At work now but sure I can

At work now but sure I can send a no worky later. It's not that it isn't working, Just I want to use it in a different way. I am using Gael's script that is bundled with 1412 from his GIT. 

Like many, I have a lot of different scripts so I would like to make the modification in many scripts. Detach the pins that the inmoov service allocates to the second arduino for the right arm  and change them to pins the first Arduino uses for the torso.

I don't need a full script written for me. MAybe just some lines showing how to do this.

 

I can be more specific when I get home later today.

 

 

pscartozzi's picture

Hi Grog and all.Hopefully

Hi Grog and all.

Hopefully somebody see's this. Here is an example of a script I would like to modify. I am using Gael's scripts and modifying them for my com ports servo limits etc.

https://github.com/MyRobotLab/pyrobotlab/blob/master/home/hairygael/InMo...

Gaels inmoov script automatically assigns the right arm functions to the second arduino pins 8,9,10,11

I would like the right arm functions to be controlled by the first arduino's pins 27, 28, 29, 30

thanks

 

And yes, I can use the latest version. Just not sure what it is and how stable. I had downloaded a newer version then noticed an even newer version was available a couple days later so you guys must be making a lot of updates.

 

GroG's picture

Ya ... lots of updates

Ya ... lots of updates :)
But we should it should be more stable on each subsequent build .. not as many features added, we are wrapping up all lingering problems...

When a servo is currently attached to an Arduino then something tries to 're-attach' it - it will see its already attached and disregard the command.

So you need to do the 'custom' attaching first.

1. find the full name of the servos you want to move
2. find the full name of the arduino you want to attach them to
3. attach servos and arduino
4. run the rest of the script

This way the rest of the script should not interfere with your customizations...  make sense?

For example near the top of the script try this ...

i01_right = Runtime.start("i01.right","Arduino")

i01_right.connect("COM10")

i01_leftArm_bicep = Runtime.start("i01.leftArm.bicep","Servo")
i01_leftArm_rotate = Runtime.start("i01.leftArm.rotate","Servo")

i01_leftArm_bicep.attach(i01_right, 28)
i01_leftArm_rotate .attach(i01_right, 29)

... etc ..

Above we create the "right"  arduino (I don't know first vs second, the names are how the service identifies each service), and attach a few of the left arm parts...  When you run the rest of the script it "should" leave these associations in place..

I'll let you take care of the details depending on exactly what you want done..

Good Luck !   Be Patient !  Take Precautions (like standing near the power plug :) .. and Have Fun !

pscartozzi's picture

Thanks man! That helps. Up to

Thanks man!

That helps. Up to me know to nut it out.. 

MAybe if I am successful I can write a tutorial or someting to pay it forward