To use a jaguar not in the drive train you do something like this:
Code:
#include "WPILib.h"
#define AJAG_CHANNEL 1
class myRobot: public SimpleRobot
{
private:
Jaguar aJag;
Joystick aStick;
myRobot():
aJag(AJAG_CHANNEL),
aStick(1)
{
}
void Teleop(void)
{
if(aStick.GetRawButton(4))
{
aJag.Set(1.0);
}
else
{
aJag.Set(0.0);
}
}
}
All that should be correct and compilable but I didn't test is.
A few helpful tips:
When you have an object such as a jaguar that you want to interact with, type it's name and then a dot, then hit control + space on your keyboard. This key combo will show you a list of all things of the methods and attributes a class has (such as Set(float)), this can help you see what methods a class has for interacting with it's attributes.
(Methods are a fancy way of saying a function that a class has, and are marked with solid green dots next to them in the ctrl space popup)
Some common types of methods start with Get and Set, it's a pretty common for getters and setters to be provided for any attributes of a class that you should be able to tinker with (such as a motor's speed)
Ctrl + Space will also finish words for you, so if you name a two variables like this:
Jaguar jagWithNameSoLongItCausesCarpalTunnelSimplyToTypeI tsFullName;
Jaguar aJag;
if you type jag (Ctrl+Space) you'll see both variables popup in a window, if you type a W, the 'jagShooter' will go away, and if you hit CTRL+Space it will finish typing the whole rest of the other jagWithName...
Another great way to explore classes is to CTRL+ left click on them, if you CTRL+click aJag, you will go to where is declared, if you CTRL+click Jaguar, you will go where it is declared, which will be "Jaguar.h" which will show you this:
Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#ifndef JAGUAR_H
#define JAGUAR_H
#include "SafePWM.h"
#include "SpeedController.h"
#include "PIDOutput.h"
/**
* Luminary Micro Jaguar Speed Control
*/
class Jaguar : public SafePWM, public SpeedController, public PIDOutput
{
public:
explicit Jaguar(UINT32 channel);
Jaguar(UINT8 moduleNumber, UINT32 channel);
virtual ~Jaguar();
virtual void Set(float value, UINT8 syncGroup=0);
virtual float Get();
virtual void Disable();
virtual void PIDWrite(float output);
private:
void InitJaguar();
};
#endif
so you can see all the methods and attributes of the class.
These two things are great for getting to know what your options are in any objects in an object oriented environment!
Hope you found this helpful
Edit: Also,
http://www.cplusplus.com/doc/tutorial/ is an excellent resource for learning (and for reference), it's easier to follow along than a video you gotta pause all the time

(but you do have to read

)