|
Page 1 of 1
|
[ 4 posts ] |
|
| Author |
Message |
|
gh9310
Rookie
Joined: Wed Feb 02, 2011 10:45 pm Posts: 3
|
 HELP ENCODER NOT WORKING
we have tried everything including the sample programs and still the enconder doesn't work, the pragmas seem to be right and the cables are well plugged in to the controller, therefore the encoder should work but it isnt working! we would really appreciate some help
|
| Wed Feb 02, 2011 11:26 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2906 Location: Rotterdam, The Netherlands
|
 Re: HELP ENCODER NOT WORKING
Without code it is really hard to guess what could be wrong.
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Thu Feb 03, 2011 1:58 am |
|
 |
|
gh9310
Rookie
Joined: Wed Feb 02, 2011 10:45 pm Posts: 3
|
 Re: HELP ENCODER NOT WORKING
here is the code with the pragmas and everything;
#pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl, encoder) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main () { nMotorEncoder[motorE]= 0; //Tetrix encoder reset
nMotorEncoderTarget[motorE]= 1440; // Position
motor[motorE] = 20;
}
|
| Thu Feb 03, 2011 10:11 am |
|
 |
|
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1023
|
 Re: HELP ENCODER NOT WORKING
Your program ends right after setting the motor in action. When the program ends, it kills your motor. If you want to see the motor moving put a wait after you set the motor.  |  |  |  | Code: #pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl, encoder) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main () { nMotorEncoder[motorE]= 0; //Tetrix encoder reset nMotorEncoderTarget[motorE]= 1440; // Position motor[motorE] = 20; wait1Msec(5000); //wait 5 seconds } |  |  |  |  |
|
| Thu Feb 03, 2011 1:45 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 3 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
|
|