
Re: Sample Joystick program
Unfortunately, I think that particular sample file needs to be deleted. For one, it has the motor control lines commented out which is why you do not see any response from the motors.
Here is a better basic example:
 |  |  |
 | Code: #pragma config(Hubs, S1, HTMotor, HTServo, none, none) #pragma config(Motor, mtr_S1_C1_1, leftMotor, tmotorNormal, openLoop) #pragma config(Motor, mtr_S1_C1_2, rightMotor, tmotorNormal, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c"
task main() { while (true) { getJoystickSettings(joystick);
motor[rightMotor] = joystick.joy1_y1; motor[leftMotor] = joystick.joy1_y2;
} } |  |
 |  |  |
This code should do what you were expecting from Joystick1.c, but is pretty trivial and limited in usefulness. For example, it does not properly scale the joystick analog stick values (-127 to 128) to the motor range (-100 to 100).
Assuming you are in fact competing in FTC: Lego Mindstorms NXT + Tetrix
You can run the program as is for now, but will need to use the autonomous and teleop templates available at
http://www.ftctraining.com to be competition legal.
What I would recommend is to watch the videos and read the documentation available at:
http://www.ftctraining.comhttp://www.robotc.net/content/webinar/index.htmlhttp://www.education.rec.ri.cmu.edu/content/lego/index.htmThat should answer a lot of your initial questions to help get you up and running.