To use "printf", simply do
Code:
printf("Hello World!");
Or if you want to print a variable:
Code:
float number = 7.241;
printf("The value is: %f", number); // The value is: 7.241
And you need the cRIO connected to your computer via a serial cable to see the output
For the joystick issue, (I haven't actually tested it myself), I think it should work like:
Code:
Joystick stick(1); // Joystick plugged into USB port 1
Servo sv1(5);
if(stick.GetRawButton(2))
{
// Set the servo
sv1.set(someAngle);
}
Hope this helps, haven't actually tried this myself
