Drive() Not a Standard Toolset in EasyC?

I was reading the WPI Documentation, bty…nice piece of work…

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:

Would you happen to have a glossary of function in the WPI library? We don’t want to miss anything that can be useful. :smiley:


It turns out that you can use all the WPILib functions from EasyC. Since EasyC includes WPILib, you only need to be able to reference the functions that you use.

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):

#include "Main.h"

void main ( void )
      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);

You will be able to use any of the functions in BuiltIns.h with User Code blocks. All the functions are described in the WPILib documentation. There are a few new functions that are described on the web site that haven’t made it into the document, but I’ll try to get that done.

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.

Come on now…if they are “SO COOL” how come it’s not a standard toolset? You guys are trying to keep it a secret aren’t you? :wink:

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.