View unanswered posts | View active topics It is currently Tue Sep 16, 2014 5:30 pm






Reply to topic  [ 1 post ] 
Yellow line in the sample encoder program 
Author Message
Rookie

Joined: Sun Jul 20, 2014 10:21 am
Posts: 5
Post Yellow line in the sample encoder program
I was changing some thing in the sample program for the encoders, and now I get a yellow line through "task main". Not sure what the problem is. What does the yellow line mean? Thanks. Bob
#pragma config(Sensor, dgtl2, rightIEM, sensorQuadEncoder)
#pragma config(Sensor, dgtl4, , sensorQuadEncoder)
#pragma config(Sensor, I2C_1, rightIEM, sensorNone)
#pragma config(Sensor, I2C_2, leftIEM, sensorNone)
#pragma config(Motor, port2, rightMotor, tmotorVex269_MC29, openLoop, reversed, encoderPort, dgtl2)
#pragma config(Motor, port3, leftMotor, tmotorVex269_MC29, openLoop, encoderPort, dgtl4)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

/*+++++++++++++++++++++++++++++++++++++++++++++| Notes |++++++++++++++++++++++++++++++++++++++++++++++
Move Forward and Backward - 269 Motors
This program instructs your robot to move forward at half power for 1000 encoder counts, then reverse
at half power for 1000 encoder counts. There is a two second pause at the beginning of the program.

Robot Model(s): Modified Squarebot

[I/O Port] [Name] [Type] [Description]
Motor Port 1 rightMotor 269 Motor Right side motor, Reversed
Motor Port 10 leftMotor 269 Motor Left side motor
I2C_1 rightIEM Integrated Encoder Encoder mounted on rightMotor
I2C_2 leftIEM Integrated Encoder Encoted mounted on leftMotor
----------------------------------------------------------------------------------------------------*/

task main
{
wait1Msec(2000);

//Clear the encoders associated with the left and right motors
nMotorEncoder[rightMotor] = 0;
nMotorEncoder[leftMotor] = 0;

//While less than 1000 encoder counts of the right motor
while(nMotorEncoder[rightMotor] < 1000)
{
//Move forward at half power
motor[rightMotor] = 63;
motor[leftMotor] = 63;


Wed Aug 27, 2014 3:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.