View unanswered posts | View active topics It is currently Tue Sep 23, 2014 12:17 am






Reply to topic  [ 3 posts ] 
How to define...? 
Author Message
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post How to define...?
I'm using the Hi-Technic IR-Link to control 6 motors, and want to assign a name to each one so that I don't have to remember the channel and port their on. An example command:

Code:
PFMotor(PneumSwtch, (ePWMMotorCommand)7);//with name.
PFMotor(pfmotor_S1_C1_A, (ePWMMotorCommand)7);//without name.

I've tried, but I really have no idea what to do. I think I would use #define, but I don't know how. Can anyone help me?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Fri Feb 17, 2012 11:10 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: How to define...?
You could declare it like this:
Code:
tPFmotor PneumSwtch = pfmotor_S2_C1_A;
PFMotor(PneumSwtch, MOTOR_FWD_PWM_7);

I haven't tested this. In fact, I had completely forgotten that you could even do this with my IRLink driver, haha. I had to look at the code to see how it worked :)

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Feb 17, 2012 11:18 am
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: How to define...?
mightor wrote:
You could declare it like this:
Code:
tPFmotor PneumSwtch = pfmotor_S2_C1_A;
PFMotor(PneumSwtch, MOTOR_FWD_PWM_7);

I haven't tested this. In fact, I had completely forgotten that you could even do this with my IRLink driver, haha. I had to look at the code to see how it worked :)

- Xander


Thank you!!! Works perfectly!!!

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Fri Feb 17, 2012 11:50 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.