Servo Macro Automove

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dawladin
Posts: 13
Joined: Mon Feb 04, 2013 12:05 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Servo Macro Automove

Post by dawladin »

Hello flowcode users and adimistators

I got one question how to you know where the servo is when you use the automove macro in flowcode v4

Thanks for reading this post and i hope that you got a solution

Regards Michael

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Servo Macro Automove

Post by dazz »

Hi
The component macros remember the 0 position and it counts from there.
I cant post a flowchrt as ive only got V5 and your using V4.
so open a new flowchart, add a servo component, add a servo enable macro( remember the first servo is servo 0 in the macro's) drag a few call component macro's into flowcode and a matching number of delays(set the delays to 2 seconds) set up each call component macro to a number between 0 and 255 (making every other call a zero. run in sim and you will see the servo always goes back to the zero position), See below for an example
one other thing to note is if you put to large a number in it will default to tens for the position, so if you added automove 399 it would move to position 39

automove 0
Delay 2 seconds
automove 134
Delay 2 seconds
automove 0
Delay
automove 244
Delay 2 seconds
automove 0
Delay
automove 76
Delay 2 seconds
automove 0
Delay 2 seconds

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Servo Macro Automove

Post by Benj »

Hello,

If you need to monitor the position during an automove command then you can do this by creating a flowcode byte variable called position and then using a C icon to load the current servo position into the position variable.

Code: Select all

FCV_POSITION = MX_SERVO_POSITION[0];
The 0 can be set to 0 - 7 to reference servo 0 to 7.

dawladin
Posts: 13
Joined: Mon Feb 04, 2013 12:05 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Servo Macro Automove

Post by dawladin »

Thank you very much dazz and benj :)

It worked perfectly so can't say anything else then much appericated guys

Regards Michael

Post Reply