View Single Post
  #2   Spotlight this post!  
Unread 02-02-2009, 23:33
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Control Mapping problems in WindRiver

Quote:
Originally Posted by ExarKun666 View Post
1) when we use Joystick to do the function GetX() it says GetX() hasn't been defined, and we tried Joystick.GetX() and it says you need a parent class or something b4 Joystick, so how do I declare GetX??
You need to create an instance of the Joystick class. This should be done as a member variable in your robot class, outside of any of the functions in it.
Code:
Joystick stick(1); // USB joystick in port 1.
After you have your Joystick object created, you can use it like this:
Code:
float value = stick.GetX(); // Get the X value of the joystick.
You can read more about C++ classes here.

Quote:
Originally Posted by ExarKun666 View Post
2) We are trying to use the log function also in this, but we can't find a way to convert float to a non double number or a double number for use by myRobot.*.* ect...
I'm not quite sure what you're asking about, but the log() function should work just fine with floats. You just need to #include <math.h>.

Quote:
Originally Posted by ExarKun666 View Post
3) How do you do a state machine with a button?
Again, I'm not entirely sure what you want to do, but if you're talking about using a button to toggle something on/off that has been discussed here: http://www.chiefdelphi.com/forums/sh...ad.php?t=72749
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote