Timing a slider

Apologies if this is a dumb question. I have a servo motor hooked to a Pi Zero. Need to be able to control the duration of rotation of the motor. It is a 180 deg move. Need to be able to set how long it takes for the 180 deg rotation. I don't know how to code and assume that this could be easily set with the function node. Is there a node that would allow me to do this without writing a function?.

Use a Trigger node to send the start action and then, after the timeout, the stop action. You can use msg.delay to set the time, as described in the help text for the node.

Perhaps I have misinterpreted the question, if I have then please explain in more detail what you are trying to do.

@Colin Thanks for your time. I want to be able to change the time it takes the servo to move from 0 to 180. Not at what time it happens but how long it takes to do so. Input, say 5 sec, and have the servo take 5 sec to move from 0 to 180.

It still isn't clear what you mean. I would have thought that the time it takes to get from one end to another is defined by the servo itself.
Or do you mean you want to generate a ramp output from a node that goes from one value to another in a time you can choose?

@Colin Hmm. Lets see. I want to alter the speed of rotation so that I can rotate the servo at different speeds determined by the amount of time it takes to do a 180 deg turn. If I input 2 sec the servo rotates at a particular speed to achieve the 180 deg turn. If I input 4 sec it should move at half the speed to achieve the 180 deg turn. Hope this is clearer.

I will refer you to a post which I believe may help you - (by @Colin) :rofl:

Thank you. @smcgann99 Will give it a try. Much appreciated. I knew that it could be coded but was wondering if there were nodes that allowed you to do this for us non-coders.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.