Go to Post I think the winning robot will be the same as every other year, a robot that is excellent at ONE thing. - Kel D [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 03-22-2013, 04:52 PM
austpet1230's Avatar
austpet1230 austpet1230 is offline
Registered User
FRC #4459 (Leotechs)
Team Role: Leadership
 
Join Date: Mar 2013
Rookie Year: 2011
Location: United States
Posts: 9
austpet1230 is an unknown quantity at this point
Re: Initializing and Using Buttons to Control Victor Motor Controllers

Sorry, I meant to ask about the servo motors not the victor motors. If one were trying to initialize and use the servo motors would it be initialized like this (initializing two servos):

Code:
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stickRight, stickLeft; // only joystick
        Servo (servoa); //Initialize servo 1 (or a)
        Servo (servob);  //Initialize servo 2 (or b)
and if this is correct, then how would one go about programming these to buttons? Could this code work?

Code:
//Example code
if ((stickRight->GetRawButton(4) == 1))
	{
		servoa->Set(.7f);
	}
else if (stickRight->GetRawButton(4) == 0)
	{
		servoa->Set(0.0f);
	}
Thank you for your help.
__________________
If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on.
-Steve Jobs

R.I.P. Steve Jobs 1955 - 2011. The Greatest Innovator of all time.

Last edited by austpet1230 : 03-23-2013 at 10:16 AM.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:52 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi