Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Programming a third port (http://www.chiefdelphi.com/forums/showthread.php?t=63801)

arhajder 11-02-2008 15:17

Programming a third port
 
Hello my team wants to program the third port.What we did was change everything that said port1 or port2 and put in port3. we got a failled build that said
SPBRG3 AND TXSTA3bits is not defined.

How can we fix this problem?all are welcome(KEVIN!lol)

Alan Anderson 11-02-2008 15:39

Re: Programming a third port
 
What third port?

(There are only two serial ports available: the program port and the TTL port.)

arhajder 11-02-2008 16:10

Re: Programming a third port
 
if u look on the IO there are four ports. we configuered our controller so that when we press a switch it activates a motor. we want to program that port so we can use it.

Alan Anderson 11-02-2008 16:38

Re: Programming a third port
 
Again I ask, "what third port?" What are you looking at that shows four of them? Again I tell you that there are only two serial ports available.

Now I ask why a serial port has anything to do with using a switch to control a motor.

A motor usually connects to a Victor speed controller, which sets its output based on signals from one of sixteen pwm outputs on the Robot Controller. Some motors can be connected instead to a Spike relay module, which sets its output based on signals from one of eight relay outputs on the Robot Controller. Switches are typically connected directly to one of eighteen digital inputs on the Robot Controller.

IndySam 11-02-2008 16:52

Re: Programming a third port
 
Quote:

Originally Posted by Alan Anderson (Post 696776)
Again I ask, "what third port?" What are you looking at that shows four of them? Again I tell you that there are only two serial ports available.

Now I ask why a serial port has anything to do with using a switch to control a motor.

A motor usually connects to a Victor speed controller, which sets its output based on signals from one of sixteen pwm outputs on the Robot Controller. Some motors can be connected instead to a Spike relay module, which sets its output based on signals from one of eight relay outputs on the Robot Controller. Switches are typically connected directly to one of eighteen digital inputs on the Robot Controller.

Maybe he means joystick ports.

arhajder 11-02-2008 19:40

Re: Programming a third port
 
yes the joystick ports! We are using two joysticks that are connected into port 1 and port 2 on the operator interface. Then there are two extra ports(3 and 4). We created a controller that uses the third port. How would you program the third port!

psy_wombats 11-02-2008 19:42

Re: Programming a third port
 
The third port should be exactly the same as the others. Simply replace the p1 or p2 prefix with p3. There shouldn't be any other changes.

tdlrali 11-02-2008 19:42

Re: Programming a third port
 
the "aliases" for the third stick are p3_x, p3_y, and so on

arhajder 11-02-2008 19:47

Re: Programming a third port
 
which source or header file would i input my data. I cant seem to find it anywhere

psy_wombats 11-02-2008 19:48

Re: Programming a third port
 
All of the aliases are defined in the same header as the first two ports, that is, ifi_frc.h.

arhajder 11-02-2008 19:51

Re: Programming a third port
 
but where would i write

ex.if(p3_sw_trig)
pwm03=254;
else
pwm01=127

psy_wombats 11-02-2008 19:54

Re: Programming a third port
 
That should be in user_routines.c, like the other code.

arhajder 11-02-2008 19:58

Re: Programming a third port
 
the kevin watson code doesnt have user_routine. should i add it?

psy_wombats 11-02-2008 20:02

Re: Programming a third port
 
No, if you're using Kevin's code, try teleop.c, the function "void Teleop (void)" should work.

arhajder 11-02-2008 20:09

Re: Programming a third port
 
THANK YOU!

for some reason i thought teleop was the hybrid period. Thats why i have been lost for so long!:D


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

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