When you're initializing joystick, you have to put which port the joystick is plugged in to as parameter
on the sample code you'll see this
Code:
stick = new Joystick(1); // create the joysticks
that "Joystick(1)" (which is constructor) means that it'll have control over Joystick that is plugged into port 1 on Driver Station
if for some reason it doesn't work, then it can be joystick driver software problem, which can be solved by copying driver file to USB Memory Stick(Mass Storage Device) and then plugging into driverstation.
I do not know the procedure of installing driver software since we didn't get new controller yet, but I heard that it can be done on both on-line and off-line workshops
also as I searched through some beta testing teams' codes, I found out that they were using Header & Source file for the joystick so I think it can be done via programming manually instead of installing device drivers. (I didn't analyze that files so i might be wrong but it looked like those files are in charge of joysticks teams are using)
and to obtain values from joystick, if you read Joystick class under C programming reference, there are a lot of functions like GetX, GetY, GetZ, etc
you can use that to get values of joystick axis, buttons, and stuff like that