Is there a problem with this code. I keep receiving errors when I compile this. I am new at programming, so thanks for all the help.
[edit: In the real code, the brackets are spaced out. The code is not all on the left side.]
Is there a problem with this code. I keep receiving errors when I compile this. I am new at programming, so thanks for all the help.
[edit: In the real code, the brackets are spaced out. The code is not all on the left side.]
Yes, a couple
This
if(SensorValue(sensorTouch == 0)
should be this
if(SensorValue[sensorTouch] == 0 )
SensorTouch I assume is already defined
There is also a missing “;” after one of your wait1Msec calls, but you can find that yourself
Use
[CODE]
tags (the # in the toolbar) to have your code formatted when posting.
Thank you!
Another question. How do I know which channels are which on the joy stick.
Also, can someone post a simple 2 motor Tank Drive program I could download and look over.
Never mind the Joystick Channels question. I just got my answer here:
http://www.robotc.net/support/vex/WebHelpCortex/index.htm#page=functions_vex/remotecontrol/VEXnet_Remote_Control.htm
From C:\Program Files\Robomatter Inc\ROBOTC Development Environment\Sample Programs\VEX2\Remote Control\Dual Joystick Control.c:
while(1 == 1)
{
motor[leftMotor] = vexRT[Ch3]; // Left Joystick Y value
motor[rightMotor] = vexRT[Ch2]; // Right Joystick Y value
}
If you wanted to try Arcade (One stick control), then:
C:\Program Files\Robomatter Inc\ROBOTC Development Environment\Sample Programs\VEX2\Remote Control\Single Joystick Control.c:
while(1 == 1)
{
motor[leftMotor] = (vexRT[Ch2] + vexRT[Ch1])/2; // (y + x)/2
motor[rightMotor] = (vexRT[Ch2] - vexRT[Ch1])/2; // (y - x)/2
}
The channels are printed on the joystick itself.