View Single Post
  #2   Spotlight this post!  
Unread 19-04-2007, 17:55
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: turning inputs into outputs

In FRC, a very simple version (that you could put in your main user routines) would look like:

This is for the 2006 FRC controller, things may have changed since then.
Code:
unsigned int analog_value,output_value;

// this is a 10-bit value, which means it is between 0 and 1024
analog_value = Get_Analog_Value(rc_ana_in01); 

// chops off the 2 least significant bits to make it an 8-bit value
output_value = analog_value>>2;

// the pwm outputs are all 8-bit
pwm01 = output_value;
Things that may be different for the vex controller, and I'm not sure of:
-The analog inputs may be a different # of bits than the FRC controller is, so you'd have to remove more or less of the least significant bits
-The Get_Analog_Value function may be different. In any case, there should be some function defined in all the ifi_blah.h files that allows you to retrieve the analog input values


Edit: Is that Huron Heights in the Kitchener/Waterloo region?
Edit2: I'm guessing it is the Huron Heights in Newmarket. Did you guys get started from 1281?

Last edited by Bongle : 19-04-2007 at 18:00.