Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Encoder Code (http://www.chiefdelphi.com/forums/showthread.php?t=41815)

Kevin Watson 23-01-2008 22:04

Re: Encoder Code
 
Quote:

Originally Posted by John Hooper (Post 684562)
I have MPLAB 8.1, compiler 3.1 set up with Kevin Watson's FRC code, which does compile.

Open up teleop.c in your editor. The one function you really need to know about is Teleop(). During teleoperation mode this function is called when new data has been received from the operator (i.e., robot driver) interface, which has a bunch of joysticks attached. This happens every ~26ms. The idea is to take the driver's input and use it to control a motor. The simplest case would be something like:

pwm07 = p1_y;

This maps the y-axis of the joystick attached to port one of the operator interface to the motor controlled by PMW output seven. The variables are unsigned chars where neutral is 127, full reverse is 0, and full forward is 255. pwm07 and p1_y are #defined in ifi_frc.h. The default mapping that has been used in the past can be found in ifi_code.c/Default_Routine().

-Kevin

avitzur 18-02-2008 10:02

clock cod
 
I am using the 'frc_encoder' from 2006 as a base project and C18 2.4

I wont to use your new 'clock' file from 2008 but it looks for 'ifi_frc.h'
what can i do ??????

avi:ahh:

Kevin Watson 18-02-2008 12:56

Re: clock cod
 
Quote:

Originally Posted by avitzur (Post 701487)
I am using the 'frc_encoder' from 2006 as a base project and C18 2.4

I wont to use your new 'clock' file from 2008 but it looks for 'ifi_frc.h'
what can i do ??????

avi:ahh:

Replace that #include statement with this one: #include <p18cxxx.h>. If you're using 2006 code, it's important to make sure you follow the steps in this document too.

-Kevin


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

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