Servo 180 deg. Rotation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

kunibabina
Posts: 11
Joined: Thu Sep 16, 2010 12:00 am
Contact:

Servo 180 deg. Rotation

Postby kunibabina » Tue Mar 27, 2012 12:55 am

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..

cobra1
Posts: 175
Joined: Thu Feb 04, 2010 7:44 am
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: Servo 180 deg. Rotation

Postby cobra1 » Tue Mar 27, 2012 4:41 pm

Can you post the C code please

kunibabina
Posts: 11
Joined: Thu Sep 16, 2010 12:00 am
Contact:

Re: Servo 180 deg. Rotation

Postby kunibabina » Tue Mar 27, 2012 5:11 pm

It comes with the Flowcode in the components folder inside the installation directory..

cobra1
Posts: 175
Joined: Thu Feb 04, 2010 7:44 am
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: Servo 180 deg. Rotation

Postby cobra1 » Tue Mar 27, 2012 8:54 pm

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?

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8479
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2435 times
Been thanked: 3491 times
Contact:

Re: Servo 180 deg. Rotation

Postby medelec35 » Tue Mar 27, 2012 11:11 pm

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
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

kunibabina
Posts: 11
Joined: Thu Sep 16, 2010 12:00 am
Contact:

Re: Servo 180 deg. Rotation

Postby kunibabina » Wed Mar 28, 2012 3:09 am

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.