Go to Post -Our engineering mentor, Mr. Wittel- *crossing arms and sitting down* "Ahhh. I love work. I could watch it all day." - OverdriveAdge [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 21-04-2012, 10:03
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
Re: Inovation First FRC Robot Controller

yes i do have a serial port and a usb converter
  #17   Spotlight this post!  
Unread 21-04-2012, 11:00
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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
  #18   Spotlight this post!  
Unread 21-04-2012, 12:11
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #19   Spotlight this post!  
Unread 21-04-2012, 12:26
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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?
  #20   Spotlight this post!  
Unread 21-04-2012, 13:13
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Inovation First FRC Robot Controller

Quote:
Originally Posted by SeanPerez View Post
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.
  #21   Spotlight this post!  
Unread 21-04-2012, 13:14
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
Re: Inovation First FRC Robot Controller

yes i did
  #22   Spotlight this post!  
Unread 21-04-2012, 13:26
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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

Last edited by SeanPerez : 21-04-2012 at 13:55.
  #23   Spotlight this post!  
Unread 21-04-2012, 13:56
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #24   Spotlight this post!  
Unread 21-04-2012, 14:03
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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?
  #25   Spotlight this post!  
Unread 21-04-2012, 14:06
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-04-2012 at 06:52.
  #26   Spotlight this post!  
Unread 21-04-2012, 14:38
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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
  #27   Spotlight this post!  
Unread 21-04-2012, 14:48
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-04-2012 at 15:44. Reason: Forgot you were using Watson's code rather that the IFI default code
  #28   Spotlight this post!  
Unread 21-04-2012, 14:55
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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?
  #29   Spotlight this post!  
Unread 21-04-2012, 15:51
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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;
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #30   Spotlight this post!  
Unread 21-04-2012, 17:51
SeanPerez SeanPerez is offline
Registered User
FRC #2625 (Arc Reactor)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mississauga
Posts: 45
SeanPerez is an unknown quantity at this point
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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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