|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Beacon Code on Full Size RC?
OK, strange question, but can the beacon code be quickly and easily transferred to the full size RC?
My team's mentor is going to be on a business trip for a few days, and we'd like to test the IR code using the edubot as a robot, and the RC as the beacon, but we're not sure if you can easily transfer the code. And if someone already asked this, um, yeah, I'm just stupid then . |
|
#2
|
|||||
|
|||||
|
Re: Beacon Code on Full Size RC?
Quote:
The biggest difference is you'll have to change the beacon code to use two of the PWMs 13-16 rather than the PWMs 1 & 2 used on the EDU controller. |
|
#3
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
Quote:
1) Drop a copy of beacon.c and beacon.h into a directory containing a fresh copy of the default EDU-RC code. 2) Use the project wizard to create a new project with the default code and beacon files. 3) Edit user_routines.c adding #include <beacon.h> in the #include area near the top and then a call to to Initialize_Beacon() in User_Initialization(). 4) Change the call to Setup_PWM_Output_Type() to look like this: Setup_PWM_Output_Type(USER_CCP,USER_CCP,IFI_PWM,IF I_PWM); 5) You may also need to comment out the call to Generate_Pwms() in Process_Data_From_Master_uP(). 6) While you're there, comment out the Default_Routine() and printf() calls in Process_Data_From_Master_uP(). 7) Build and load the new .hex file. 8) Beacon type-0 should be on PWM13 and type-1 should be on PWM14. Let us know if it works. BTW, the tracking code works just fine on the EDU-RC. Here's a copy that'll get you started. -Kevin |
|
#4
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
I'll try, but I didn't get a chance to grab the RC, so I'm not sure if I can do anything with this. Kind of frustrating, when you can't do anything for half a week... :-\
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
Quote:
-Kevin |
|
#7
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
Quote:
Code:
#define _FRC_BOARD Generate_Pwms(pwm13,pwm14,pwm15,pwm16); something we just found out is that when we reset the rc, the program light starts flashing green and red alternately, the code error light on the oi goes off, the pwm1 and 2 lights turn on, and the error on the dashboard goes away, but the infrared beacon doesnt go on, and all i can see on the pwm outputs on an oscilloscope looks like just 60 hz noise, so i dont think anything is actually being outputted. ill do some more testing tomorrow, but advice would be greatly appreciated. |
|
#8
|
|||||
|
|||||
|
Re: Beacon Code on Full Size RC?
Quote:
Code:
const int SomeVal = 321;
#define SomeAlias SomeVal
void SomeSub(void)
{
if (SomeVal == SomeAlias)
Code_Allways_Executes();
if (SomeVal <> SomeAlias)
Code_Never_Executes;
}
Code:
const int SomeVal = 321;
void SomeSub(void)
{
if (SomeVal == SomeVal)
Code_Allways_Executes();
if (SomeVal <> SomeVal)
Code_Never_Executes;
}
Of course, I don't know all the ins and outs of C, so check the FRC default code. |
|
#9
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
no... this is in ifi_utilities.h:
Code:
#ifdef _FRC_BOARD
/* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_13,unsigned char pwm_14,
unsigned char pwm_15,unsigned char pwm_16);
#else
/* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_1,unsigned char pwm_2,
unsigned char pwm_3,unsigned char pwm_4,
unsigned char pwm_5,unsigned char pwm_6,
unsigned char pwm_7,unsigned char pwm_8);
#endif
|
|
#10
|
||||
|
||||
|
Re: Beacon Code on Full Size RC?
okay, we figured it out... in user_routines_fast.c we actually have to add the interrupt handler thats in the beacon project but not in the frc default code. it works now!
edit: well, it compiles and runs without errors, but the waveform isnt correct... ill keep working on it edit: okay, well, no one ever told me the output would be on pwm13 and 14 for the frc... it works now(: this should be very helpful for us. Last edited by doy : 24-01-2004 at 16:05. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is your most prefered programming language? | Hailfire | Programming | 156 | 19-01-2005 21:42 |
| InfraRed autonomous code ... | mtrawls | Programming | 1 | 11-01-2004 00:25 |
| Autonomous code | PBoss | Programming | 7 | 14-01-2003 15:29 |
| Does your team use the Default code. | Jeff McCune | General Forum | 2 | 09-01-2003 14:46 |
| Patent source code? | Kyle Fenton | Chit-Chat | 3 | 20-10-2001 17:53 |