Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Source code for the Easy C Pro library functions? (http://www.chiefdelphi.com/forums/showthread.php?t=53300)

bobpskier 02-02-2007 17:47

Source code for the Easy C Pro library functions?
 
Is possible to look at the source behind the library functions supplied with Easy C Pro for FIRST? For instance can we download the source to the Arcade drive function to see how it is actually coded?

Thanks,

Bob Potterveld

Kingofl337 02-02-2007 23:37

Re: Source code for the Easy C Pro library functions?
 
I'm sorry but the complete source isn't available. But, most of the functions are pretty strait forward. Brad can also post bits of code if he wants.

BradAMiller 05-02-2007 10:16

Re: Source code for the Easy C Pro library functions?
 
Quote:

Originally Posted by Kingofl337 (Post 570619)
I'm sorry but the complete source isn't available. But, most of the functions are pretty strait forward. Brad can also post bits of code if he wants.

The 2 motor arcade code looks like this:
Code:

void Arcade2(unsigned char movePort, unsigned char moveChannel,
        unsigned char rotatePort, unsigned char rotateChannel,
        unsigned char leftMotor, unsigned char rightMotor,
        unsigned char leftInvert, unsigned char rightInvert)
{
        int moveValue, rotateValue;
        int leftMotorValue, rightMotorValue;
        moveValue = ((int)GetOIAInput(movePort, moveChannel)) - 127;
        rotateValue = ((int)GetOIAInput(rotatePort, rotateChannel)) - 127;
        rightMotorValue = moveValue + rotateValue;
        leftMotorValue = rotateValue - moveValue;
        if (leftInvert) leftMotorValue = - leftMotorValue;
        if (rightInvert) rightMotorValue = - rightMotorValue;
        SetPWM(leftMotor, pwmLimit(leftMotorValue + 127));
        SetPWM(rightMotor, pwmLimit(rightMotorValue + 127));
}

If you were interested because of wanting to make some changes, you can simply include your own version of this function in your easyC or WPILib program and it will be used instead of the library routine. That's the nice thing about libraries - your project code takes precedence.

bobpskier 05-02-2007 21:39

Re: Source code for the Easy C Pro library functions?
 
Thanks for the post Brad. We are worried about overdriving our motor and might need to be able to adjust how this function works for some of the extremes during operator control.

Bob Potterveld


All times are GMT -5. The time now is 18:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi