I know this has been changing. What is the correct way to adust limits and scale a servo. I am using 1723.

I am using

leftArm.bicep.setMinMax(40,85)
leftArm.bicep.map(0,180,85,40)
 
-for me the bicep servo has a range of 40-85
-I need to reverse the servo direction
-does this make it so when I want to move the servo throughout its range of 40-85 I can now send a command between 0 and 180?
-Why do I have to set a range? Can't it ust be identified in the mapping line?
 
Thanks
 

moz4r

7 years 9 months ago

Hi this is what I use with succes about last mrl  :

leftArm.bicep.map(0,180,40,85)
leftArm.bicep.setInverted(True)

maps are working since a long time, you certainly can't find any version of MRL without it

 

the best way to map  a servo is to start with the default map and your servo in a safe position (far from the min/max.

You slowly change the position of the servo until you reach the minimum position (or the maximum position) and note what position it is.

then the setting is map(0,180,minPos, maxPos)

after that you can move the slider between 0 and 180 and the servo will move between it's min and max position

simple

Hi Calamity,

Thanks for the response.

- for reversing is it better to switch the last two numbers or use the setinverted command as suggested above.

-Do I need to still set a range for the servo? Seems like this line handles it.

 

Thanks!

setInverted or switching the number do exactly the same thing. It just a mather on how you see it, but you can't use map(180,0,0,180) this won't work but map(0,180,180,0) is the same thing as map(0,180,0,180) and setInverted(True)

 

I'm not sure I understand what you mean in your second question. if you mean setMinMax(), no you don't need cause the map() function is setting the min/max value.