|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Programming: MotorRcControl() vs GetRxInput()/SetServo()
Ok, I've been beating my head against this for a couple of days and haven't solved the problem. If I do the following, things work fine:
while(1) { // control motor connected to #8 with channel #3 MotorRcControl(1, 3, 8, 0); } ...but the following makes the servos connected to the uController go nuts: int armASpeed = 0; while(1) { // control motor connected to #8 with channel #3 armASpeed = GetRxInput(1, 3); PrintToScreen("armASpeed: %d", armASpeed); SetMotor(8, armASpeed); } Also, I see a value of 127 returned, no matter the position of the R/C stick. If I comment out the SetMotor() call I see the value of armASpeed change with the R/C stick position, as I would expect. So, it appears to be related to the SetMotor() call. I've checked the arguments against the UserAPI.h headers. Do I have a syntax problem? Is it timing? I don't trust this dual processor arrangement (it seems fragile) and I suspect it might be involved. Thanks, -Glenn |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Vex w/ MPLab | dababyjebus | FIRST Tech Challenge | 27 | 25-04-2008 09:11 |
| Programming - Getting Started | Mark McLeod | Programming | 80 | 16-04-2008 23:37 |
| VEX programming | Gene F | Programming | 14 | 08-08-2006 22:21 |
| Programming Forum Warning | Brandon Martus | Announcements | 10 | 29-12-2005 13:32 |
| Robot Programming Education | phrontist | Programming | 11 | 03-05-2004 07:32 |