|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Vex Library and Sample Code
Quote:
the short answer is study the sample code and refer to the 18f8520 datasheet, (watch any ad for a prescription med on the tele for a list of possible side effects), and have a look at theEntropyWorks.com, (a fine example of good intentions and what becomes of them). anyway, to use pin 1 for input initialize io1 = 1 and to set it to output io1 = 0. when the rc powers up all pins are set to input so that you need not worry that the attached chainsaw on your deathbot will gobble your arm before you can jump clear. must go to work... |
|
#2
|
|||
|
|||
|
Re: Vex Library and Sample Code
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 think Brad Miller's WPILib will solve some of the rest of the problems, but I'll have to wait until that's out to see. Thanks for your reply. Tac |
|
#3
|
|||
|
|||
|
Re: Vex Library and Sample Code
Quote:
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;
}
|
|
#4
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |