Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Inovation First FRC Robot Controller (http://www.chiefdelphi.com/forums/showthread.php?t=105817)

SeanPerez 21-04-2012 10:03

Re: Inovation First FRC Robot Controller
 
yes i do have a serial port and a usb converter

SeanPerez 21-04-2012 11:00

Re: Inovation First FRC Robot Controller
 
When i go to open project it does not allow me to choose the mcp file. it lets me choose ifi_frc.X
Is that right?

I am using mplabx v1.10, not mplab 8.00 so i dont know if there is any differences.

If it makes a difference, my install directory for mplabx v1.10 is:
c:\prgram files(x86)\microchip
i used default settings for everything i installed

Also i dont find this:
Project -> Build Options -> Project

how do i choose Suit Defaults?

And i not sure how to make sure these paths are assinged correctly
•Include Path c:\mcc18\h
•Library Path c:\mcc18\lib

Mark McLeod 21-04-2012 12:11

Re: Inovation First FRC Robot Controller
 
Sorry, my directions were for MPLab.
The project you got from Kevin Watson's site is an MPLab project, so if you're using MPLabX you'll need to construct a new project and include/import the .c/.h/.lib files from the Kevin files.

SeanPerez 21-04-2012 12:26

Re: Inovation First FRC Robot Controller
 
Ok so i downloaded mplab ide v8.84

will it work on that?
i opened the project in it now i just need help configuring it and building it.

I can do the coding i just need help to configure it...

Can u give me steps please?

techhelpbb 21-04-2012 13:13

Re: Inovation First FRC Robot Controller
 
Quote:

Originally Posted by SeanPerez (Post 1160659)
for the radio i have tried a cable that i had and none of the lights lit up on the radio. i did plug the robot controller to the robot radio.
in the refrence guide it says to use a db9 male-female Pin to Pin cable. can someone give me a diagram for this pin to pin cable?

thanks

Did you figure this out? You said you got the wiring, but on some of the IFI units I've see it's not straight through.

SeanPerez 21-04-2012 13:14

Re: Inovation First FRC Robot Controller
 
yes i did

SeanPerez 21-04-2012 13:26

Re: Inovation First FRC Robot Controller
 
ok so i got everything so far to work
i got it to build properly
i got it to upload code to the rc

Now i need to test it to make sure it really does work. can someone tell me how i can do this? mabye some code? i dont have any joystics so i will have to do something thats robot sided. maybe take an input from a variable resister on an analog input and use that controll a servo? anything that will show me that it works.


Can someone help me on this?


remember that im using mplab v8.84
Thanks

Mark McLeod 21-04-2012 13:56

Re: Inovation First FRC Robot Controller
 
An easy test is to set the OI panel lights to different values in the RC code.
Code:

Pwm1_green = 1;  //or = 0
Pwm1_red = 1;
Pwm2_green = 1;
Pwm2_red = 1;

Relay1_green = 1;
Relay1_red = 1;
Relay2_green = 1;
Relay2_red = 1;

Switch1_LED = 1;
Switch2_LED = 1;
Switch3_LED = 1;

Another test is to send hardcode values out to some of the Relay Outputs, then measure the outputs with a multimeter to see it they are what you expect.

SeanPerez 21-04-2012 14:03

Re: Inovation First FRC Robot Controller
 
I would do that but i dont know what the variable names are for the pins.
is there a site or document that will tell me what the variables are?

Mark McLeod 21-04-2012 14:06

Re: Inovation First FRC Robot Controller
 
You'll find all the names defined in the ifi_frc.h file, which is part of your project.
Most of them can just be set or read directly, however, the Digital I/O pins must be defined as inputs or outputs before you can use them. (defaults are defined in teleop.c).
The analog inputs can only be read using the Get_Analog_Value() function.

PWM outputs are all: pwm01, pwm02,...pwm16
Relay outputs are all: relay1_fwd, relay1_rev, relay2_fwd, relay2_rev,...relay8_rev
Analog inputs are: rc_ana_in01,...rc_ana_in16 (special handling required though)
Digital inputs are: rc_dig_in01,...rc_dig_in18
Digital outputs are: rc_dig_out01,...rc_dig_out18
The OI LED names are as I posted earlier.

SeanPerez 21-04-2012 14:38

Re: Inovation First FRC Robot Controller
 
when i try to build it i get an error

"could not find definition of symbol "delay" in ile './teleop.o'".

i just used:

delay(1000)

so i can delay the time it takes for the oi switch lights to turn after each other

Mark McLeod 21-04-2012 14:48

Re: Inovation First FRC Robot Controller
 
Did you just make that function up?

Normally, you don't want to delay any of this code.
Because this was used for FRC, there is a built-in safety that will disable the PWM outputs if the code is delayed.
In the case of just blinking the OI lights you probably won't notice that, though.

The Teleop routine is set to execute every 26.2ms.
If you want to time a blink, then just use a counter to toggle the LED value every 38 counts for a one second blink.

SeanPerez 21-04-2012 14:55

Re: Inovation First FRC Robot Controller
 
im new to coding so im good with the basics but stuff like counters i dont know what to do.

is there a way to delay things so i can still have operation of pwms?
how would i do this?

Mark McLeod 21-04-2012 15:51

Re: Inovation First FRC Robot Controller
 
I forgot you were using the Watson code rather than the IFI default code.

In Teleop, if you're changing the OI LEDs, then be sure to comment out the line
Code:

Update_OI_LEDs();
To use a counter to time things just:
  1. Declare an unsigned int counter=0;
  2. Add a line to increase it by 1 every loop, e.g., counter++;
  3. Check to see if's a multiple of 38 (for one second or equal to 38 & reset it to zero).
  4. If it is a multiple then toggle the light state, e.g., Switch1_LED = !Switch1_LED;

SeanPerez 21-04-2012 17:51

Re: Inovation First FRC Robot Controller
 
does any one have code that they have used on their robot that i can try?


i will be using mplab 8.84 so please try to give me somthing that will be error free.

Thanks


All times are GMT -5. The time now is 20:14.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi