|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Disabling the Radio Control
Hi,
Im programming the VEX using MPLAB. I have downloaded the Vex's default code, but in this code the robot can't do anything unless the radio transmitter is switched on. I want to disable this option because I don't want to use it at all (My robot is fully autonomous and is not designed for the FVC) Does anyone know how can I disable The RC? Thanks, Guy |
|
#2
|
||||
|
||||
|
Re: Disabling the Radio Control
You could try loading MasterCode Version 5
|
|
#3
|
||||
|
||||
|
Re: Disabling the Radio Control
I tried, but it didn't help.
Do I need to change anything in the code itself to make it work? Im desperate.... ![]() |
|
#4
|
|||||
|
|||||
|
Re: Disabling the Radio Control
It's pretty simple.
Just add this line to your initialization and the Master processor will ignore the radio. Do a search, it may already be in there somewhere. Code:
txdata.user_cmd = 0x02; /* Tell master you want to be in auton mode. */ |
|
#5
|
||||
|
||||
|
Re: Disabling the Radio Control
Thanks, it did work, but just when my code was in the "User_Autonomous_code" function.
I want to write it in "User_Routines_fast" in the "Process_Data_From_Local_IO" (It's faster, isn't it?) What do I need to do in order to write it there? I tried to do that and it didn't work when the transmitter was switched off, while it did work when the code was in the autonomous function. |
|
#6
|
|||||
|
|||||
|
Re: Disabling the Radio Control
Quote:
You can only update your controls at the (slower) rate the data packets arrive and leave again, no faster. Those are the GetData/PutData calls you can see in the Autonomous loop. You cannot speed them up. Process_Data_From_Local_IO runs much faster than the autonomous loop so you can do things like sample sensors. The CPU should be much faster than the rate you change your motors and stuff. You should always be able to think much faster than you can act. |
|
#7
|
||||
|
||||
|
Re: Disabling the Radio Control
So I should sample my sensors in "Process_from_local_IO" and change the motors in "User_Autonomous_Code"?
I just need to call "Process_from_local_IO" from the "User_Autonomous_Code"? But can I do it all in the "Process_from_local_IO" or will it "confuse" the CPU? |
|
#8
|
|||||
|
|||||
|
Re: Disabling the Radio Control
Quote:
Code:
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 18.5ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
/* Add your own code here. */
printf("%2x : %2x %2x %2x %2x %2x %2x\n",(int)rxdata.rc_receiver_status_byte.allbits,
(int)PWM_in1,(int)PWM_in2,(int)pwm01,(int)pwm02,(int)pwm03,(int)pwm04);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
Process_Data_From_Local_IO();
}
|
|
#9
|
||||
|
||||
|
Re: Disabling the Radio Control
You've helped me so much!
Thanks a lot! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Concept of PID explained | ConKbot of Doom | Technical Discussion | 11 | 27-01-2008 00:11 |
| Radio Problem on FRC | TuaMater | Control System | 4 | 26-01-2006 07:32 |
| 2005 RadioShack Innovation In Control Award--What Won? | Billfred | Control System | 8 | 12-06-2005 01:51 |
| Intermittant control with radio | TimeOut | Control System | 45 | 15-04-2004 12:00 |
| reworking radio control for joysticks | ajlapp | Electrical | 5 | 05-12-2003 17:38 |