Page 1 of 1

Servo 180 deg. Rotation

Posted: Tue Mar 27, 2012 12:55 am
by kunibabina
What changes has to be done in C code to make the servo rotate 180 deg. instead of current 120 deg. ? In other words, how to change to 2200us instead of current 1280us..Thanks in advance..

Re: Servo 180 deg. Rotation

Posted: Tue Mar 27, 2012 4:41 pm
by cobra1
Can you post the C code please

Re: Servo 180 deg. Rotation

Posted: Tue Mar 27, 2012 5:11 pm
by kunibabina
It comes with the Flowcode in the components folder inside the installation directory..

Re: Servo 180 deg. Rotation

Posted: Tue Mar 27, 2012 8:54 pm
by cobra1
Looking at the C file, there are 2 functions. 1 incriments and the other decrements.
So purely as an example, if a stepper had 360 steps, then calling the incriment function 180 times will make it move 180 degrees. So calling it 120 times will move it 120 degrees.

To move it back to 0 or "home" just reverse what you did to make it move, i.e decrement number of steps.

Hope that makes some sense

Where are you getting the uS value from?

Re: Servo 180 deg. Rotation

Posted: Tue Mar 27, 2012 11:11 pm
by medelec35
What version of Flowcode are you using as your post is in Flowcode V2 & V3 section?
I thought Servo component is only available for non free versions of Flowcode 4 and Flowcode 5.
Did not think was available for Flowcode 3?

Martin

Re: Servo 180 deg. Rotation

Posted: Wed Mar 28, 2012 3:09 am
by kunibabina
I had visited one institute and was using there but for posting in Flowcode 4 we have to enter license. They said we cannot share license details to outstation faculties and they haven't co-operated me. So I posted in Flowcode V2 & V3. Without Matrix Multimedia's permission it may be illegal to post the code. So I said, it was available in the installation folder.