Quote:
Originally Posted by ExarKun666
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
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
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