|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Drive() Not a Standard Toolset in EasyC?
I was reading the WPI Documentation, bty...nice piece of work...
http://users.wpi.edu/~bamiller/WPILib/WPILib.pdf anyway, I noticed that WPI has some functions that are interesting, like Drive(); Drive looks like it supports some deadband handling unlike SetPWM built into EasyC toolset. Also the changelog of WPI indicates it might help with some PID controls, which we are attempting in EasyC with encoders... My question is, I don't see Drive() in the standard tool set, however I think we could call this function by doing a User Code Toolset, then typing Drive() Haven't tried it yet. I also wondered and saw in your Tutorials like Tutorial 7, that Drive () and Motor () function are listed. Do we just need to recode this in our project as you've provided in Tutorial 7 or is that already part of the WPI library and we can call the function by doing a User Code and typing Drive () to call the function? Other functions not found in the EasyC toolset include: Drive() Motor() Motors() Would you happen to have a glossary of function in the WPI library? We don't want to miss anything that can be useful. Thanks! Last edited by Chris_Elston : 07-02-2006 at 12:56. |
|
#2
|
|||
|
|||
|
Re: Drive() Not a Standard Toolset in EasyC?
Quote:
To do this, use the "File inclusion" option and add the file "BuiltIns.h". BuiltIns.h is not included with EasyC, but it is included with WPILib. So get WPILib, extract the include file and put it into your project directory, then refer to it in the File inclusion dialog. Here is a sample program that uses the Drive functions you were referring to (from an EasyC program - the functions are all from User Code program blocks): Code:
#include "Main.h"
void main ( void )
{
TwoWheelDrive(1,3);
Drive(127,0); // drive forwards
Wait ( 1000 ) ;
Drive(-127,0); // drive backwards
Wait ( 1000 ) ;
Drive(0, 127); // make full left turn
Wait ( 1000 ) ;
Drive(0, 0);
}
|
|
#3
|
|||
|
|||
|
Re: Drive() Not a Standard Toolset in EasyC?
Actually, the drive functions are so cool that they are included in easyC, though probably not how you would have expected. They have been written completely in easyC, and are available as an easyC library. You can read more about libraries in the help file.
Just go to open file, and choose library as the file type. Your directory will switch to the default library directory. Select the library called 'drive functions', and take a look at it. It will have imported a number of user functions and variables that you can use in any program you have written. To learn more about that, take a look at 'importing functions' in the help file. |
|
#4
|
||||
|
||||
|
Re: Drive() Not a Standard Toolset in EasyC?
Quote:
It does look kewl after looking at some of the WPI documentation. We have a PID now that is a "hummer" "hunter" at "zero" velocity. It's hard to stick the setpoint at 127 in the PID without making our own deadband rules for the PID control. We are going to try it and see if the drive function can make it better for us. Thanks guys. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Drive Straight C Code using Encoders without PID? | Chris_Elston | Programming | 17 | 15-02-2005 23:41 |
| Four wheel drive question | haverfordfords | General Forum | 25 | 25-01-2005 23:24 |
| 2-wheel versus 4-wheel drive | Ben Mitchell | Technical Discussion | 23 | 07-11-2003 00:50 |
| Quad- 1/2 track drive system | Ben Mitchell | Technical Discussion | 24 | 30-01-2002 11:55 |
| "Motors and Drive train edition" of Fresh From the Forum | Ken Leung | CD Forum Support | 6 | 29-01-2002 12:32 |