Go to Post You want to be treated like a professional, so you need to continue to act like one even if the odds are against you. - Eugenia Gabrielov [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #29   Spotlight this post!  
Unread 23-01-2008, 22:04
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Encoder Code

Quote:
Originally Posted by John Hooper View Post
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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Out of the Box Camera Code russell Programming 9 21-10-2009 05:28
Kevin Watson's encoder code with RPM output MaxM Programming 2 05-02-2005 00:06
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
Updated Encoder Code Available Kevin Watson Programming 2 04-01-2005 01:00
heres the code. y this not working omega Programming 16 31-03-2004 15:18


All times are GMT -5. The time now is 21:15.

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