Go to Post "I don't have a cockroach in my presentation.... " I will remember this line forever. Thank you Autodesk. - Zyik [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

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #10   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
 


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 12:40.

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