Quote:
|
Originally Posted by Ian W.
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  .
|
Yes, it should work just fine using these steps:
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