Go to Post what the HECK are you guys using there?!?!?! - dodar [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
  #21   Spotlight this post!  
Unread 11-01-2007, 11:21
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: What are we supposed to do!?!?!?!??!?!

Quote:
Originally Posted by Bomberofdoom View Post
But we don't know what to do in EasyC. We're used to raw C code. These blocks are confusing(safe, but confusing).
I am not surprised that you are confused.

The Default code is a real mess in my opinion. It is a mix-mash of a bunch of legacy stuff from the early years of FIRST and a bunch of patches and band -aids applied to add new features and functions.

Here is the basic idea:
Inputs from the Operator Interface (OI) come from 4 ports -- they themselves are legacy 15 pin game ports from the early days of the IBM PC. Each port has switches and analog inputs.

The switches are defined this way: pN_sw_SWITCHNAME where N refers to the port number and SWITCHNAME refers to "top", "trig", "aux1" and "aux2" Depending on what brand joystick you use these switches will be available out of the box or not -- if not, and you need those switches, you will have to build a custom harness to get access to the switches. The default code has structures and aliases defined for you that allow you to treat these switches as either 1 or 0's

The analog inputs are defined this way:
pN_ANALOGNAME where N refers to the port number and ANALOGNAME
Refer to "X" "Y" "WHEEL" and "AUX" Again depending on what brand joystick you use these analog inputs will be available out of the box or not -- if not, and you need those inputs, you will have to build a custom harness to get access to the analog inputs (wiring in your own potentiometer for example). The default code has structures and aliases defined for you that allow you to treat these analog inputs as either a number between 0 and 255 -- with 127 being the nominal center position of the joystick.

You have similar naming conventions for inputs on the Robot Controller's analog and digital inputs.

The outputs on the RC are basically the PWM values 0-254 and relays (which are of the form rc_dig_outNN).

In order to control a motor, you just assign the PWM output to a value 0 = full rev, 127 = off, 254= full fwd. The default code simply maps joystick values from the OI to PWM outputs on the RC. It also has some example methods of mapping limit switches to particular PWM output so that the motor will turn off when an end of travel switch is made. If you know C and you know how to access the various inputs and outputs, you should be able to write code to let your robot do what ever you need it to do.

Good luck.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
 


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
What are Potentiometers? Theory6RobotiX Control System 18 30-12-2005 09:57
PBASIC 2.5 Software supposed to be released TODAY. Travis Hoffman Programming 7 13-01-2003 20:43
What are pneumatics? Aignam Pneumatics 23 16-10-2002 21:17
Who was supposed to be in Huntington?? Heather 45 Off-Season Events 4 16-03-2002 22:43


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

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