I hate constantly pestering everyone with my coding issues, but I am stumped!
I installed a set of quadrature encoders and was trying a simple routine to play with them but I keep getting an issue for the left encoder. I have moved it from digital ports 2-3 to 3-4, 4-5, 6-7, 7-8 and nothing helps. I have attached a picture of the error I am getting on my computer screen, as well as the code.
I get this error regardless of the value being 1000 or -1000.
What am I missing here???
http://sbdrobotics.com/wp-content/uploads/2013/02/photo1.jpg
#pragma config(Sensor, dgtl1, RightEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl7, LeftEncoder, sensorQuadEncoder)
#pragma config(Motor, port2, rightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port4, armMotorlleft, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port5, armMotorright, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port6, intakeMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port7, leftMotor, tmotorServoContinuousRotation, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
SensorValue[RightEncoder] = 0;
SensorValue[LeftEncoder] = 0;
if(nMotorEncoder(RightEncoder) <1000)
{
motor[rightMotor] = 100;
}
if(nMotorEncoder(RightEncoder) == 1000)
{
motor[rightMotor] = 0;
}
if(nMotorEncoder(LeftEncoder) <-1000)
{
motor[leftMotor] = 100;
}
if(nMotorEncoder(LeftEncoder) == -1000)
{
motor[leftMotor] = 0;
}