Vex robotics robotc4/8/2024 ![]() The problem seems to be that maybe you're thinking that the left and right encoder values will update automatically, but that is generally not the case. It looks like you don't ever update the encoder values after you initialize them. much less why it runs off into oblivion when the code should exit the while loop once the right encoder's absolute value exceeds 2000. I am not sure why the power to the wheels never changes, or why it seems to believe that the Encoder values are equal. This is a video of the code running from the debugger windows: When I run the code my robot runs without stopping and the Encoder values diverge quickly. *!!Code automatically generated by 'ROBOTC' configuration wizard !!*// #pragma config(Motor, port10, rightMotor, tmotorVex393_HBridge, openLoop, reversed, driveRight, encoderPort, I2C_2) #pragma config(Motor, port1, leftMotor, tmotorVex393_HBridge, openLoop, driveLeft, encoderPort, I2C_1) #pragma config(Sensor, I2C_2,, sensorQuadEncoderOnI2CPort,, AutoAssign ) #pragma config(Sensor, I2C_1,, sensorQuadEncoderOnI2CPort,, AutoAssign ) This is my code: #pragma config(I2C_Usage, I2C1, i2cSensors) ![]() I have a standard VEX Clawbot, which I've been trying to make go straight for some time. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |