View unanswered posts | View active topics It is currently Tue May 21, 2019 2:47 am






Reply to topic  [ 5 posts ] 
Integrated Motor Encoders 
Author Message
Rookie

Joined: Tue Oct 21, 2014 8:52 am
Posts: 3
Post Integrated Motor Encoders
I am having issues with the Integrated Motor Encoders that were purchased with the clawbot. The build was successful and I have successfully monitored them in the debugger window.
My issues: when I tell the encoders to reset they don't. SensorValue[rightEncoder] = 0
Why is there so little support with not only robotc, and the clawbot, but also with the new integrated encoders. I am trying to use the old version of Vex Video Trainer with my students yet because of the new integrated encoders I can't. Can someone please help me.
I have opened the sample code "forward for distance" changed the pragma to include the I2C encoders...


Tue Oct 21, 2014 9:21 am
Profile
Rookie

Joined: Tue Oct 21, 2014 8:52 am
Posts: 3
Post Re: Integrated Motor Encoders
Also, how do I correct my encoder that is running backwards? I can't simply flip the wires as with the non integrated encoder.


Tue Oct 21, 2014 9:43 am
Profile
Rookie

Joined: Tue Oct 21, 2014 8:52 am
Posts: 3
Post Re: Integrated Motor Encoders
Code being used:


#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, leftEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Sensor, I2C_2, rightEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port1, rightMotor, tmotorVex393_HBridge, openLoop, reversed, encoderPort, I2C_2)
#pragma config(Motor, port10, leftMotor, tmotorVex393_HBridge, openLoop, reversed, encoderPort, I2C_1)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{

SensorValue[rightEncoder] = 0; // Clear Encoders
SensorValue[leftEncoder] = 0;

wait1Msec(2000); // 2 Second Delay



motor[rightMotor] = 63; // Move Forward
motor[leftMotor] = 63;

while(SensorValue[leftEncoder] < 1800) // While less than 5 rotations on the leftEncoder...
{

}
motor[leftMotor] = 0; // Stop Motor
motor[rightMotor] = 0;
}


Tue Oct 21, 2014 9:52 am
Profile
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post Re: Integrated Motor Encoders
Try nMotorEncoder[leftEncoder] = 0;
Use >-1800 for the direction issue


Wed Oct 22, 2014 8:52 pm
Profile
Rookie

Joined: Thu Sep 11, 2014 4:47 pm
Posts: 9
Post Re: Integrated Motor Encoders
You will need to change the SensorValue[rightEncoder] sections to use the motorEncoders. Here is a link to the document I use in class. I had the same issue several months ago and the information on the document is the feedback I received. You will also need to switch to Super User under the menu tab and name the encoders under the I2c tab.

https://docs.google.com/a/svvsd.org/doc ... a2j3yvi68f


Tue Dec 02, 2014 2:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

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.