Go to Post Every team in FIRST can make this choice. Be positive, help others, and work like a maniac behind the scenes. This approach will bring you joy and satisfaction, whether you win or not. - OZ_341 [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-06-2006, 08:19
foobert foobert is offline
Registered User
no team
 
Join Date: May 2005
Location: oakland, ca
Posts: 87
foobert is a jewel in the roughfoobert is a jewel in the roughfoobert is a jewel in the rough
Re: Vex Library and Sample Code

Quote:
Originally Posted by tacman1123
Upgrading to EasyC 2.0 solved half my problem, as there is now a call GetRxInput(rx, channel) that gets the values I was looking for.
i'm guessing that rx is receiver 1 or 2 and that channel is 1 through 6. since there's no way to return an error indication, if we get rx 10, channel 9, we'll just return the first channel from the first receiver.

Code:
unsigned char GetRXInput (unsigned char rx, unsigned char channel) {
  unsigned char bar;

  switch (rx * 6 + channel) {
    default:
    case 1 : bar = PWM_in1;  break;
    case 2 : bar = PWM_in2;  break;
    case 3 : bar = PWM_in3;  break;
    case 4 : bar = PWM_in4;  break;
    case 5 : bar = PWM_in5;  break;
    case 6 : bar = PWM_in6;  break;
    case 7 : bar = PWM_in7;  break;
    case 8 : bar = PWM_in8;  break;
    case 9 : bar = PWM_in9;  break;
    case 10 : bar = PWM_in10;  break;
    case 11 : bar = PWM_in11;  break;
    case 12 : bar = PWM_in12;  break;
  }
  return bar;
}
don't forget to include ifialiases.h.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-06-2006, 16:33
Vexguy365 Vexguy365 is offline
Registered User
FRC #0365
 
Join Date: May 2006
Location: Delaware
Posts: 4
Vexguy365 is an unknown quantity at this point
Re: Vex Library and Sample Code

I have tried writing the code in MPLab but have yielded disatsrous results. I have EasyC v.1 but lost my CD after unisntalling it . Can anyone e-mail me the install file on the CD? I still have all of my other info such as installation key etc. but need the install file one the CD to reinstall it. e-mail me at beattieboy@comcast.net. Thanks - VEXguy365
Reply With Quote
Reply


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
Vex Sensor Sample Code nonother FIRST Tech Challenge 2 08-05-2006 16:49
Is there a sample code? The Stargazer Programming 3 17-02-2005 19:22
sample limit switch code??? tml240 Programming 5 17-02-2004 17:13
Sample Code (Line travel) cgav Programming 1 21-01-2004 09:37
ADC problems with C library and new code Larry Barello Programming 1 09-01-2004 22:31


All times are GMT -5. The time now is 00:59.

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