Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   A few basic EasyC Pro questions (http://www.chiefdelphi.com/forums/showthread.php?t=65733)

Joe G. 11-03-2008 17:42

A few basic EasyC Pro questions
 
I have been assigned to take the lead on programming our robot. No one else on my team has programmed before, and I only have very limited experience with EasyC V2 For Vex. I have a few questions about how to program our FRC bot with EasyC pro, as it appears very much geared towards VEX

-Do functions such as 2 motor arcade work with FRC?
-How do I add more than 2 reciever ports (four joysticks) (or is it all one port with a bunch of channels?)
-Same with PWMs, relays.
-Do I need anything special in the initialize program?
-Will the online window work with FRC?
-I assume that the Vex USB converter will also work with FRC, am I correct?

Please correct any blatant misconceptions I may appear to have through this post, as I am very much a mechanical engineer at heart:)

EHaskins 11-03-2008 17:59

Re: A few basic EasyC Pro questions
 
First you need to set EasyC to FRC mode. You can do this in options>Robot Controller Setup.

Many of the functions will change after you change controller types. Explore the environment after you change the controller.

I have never tried the online windows, so I don't know.

The converter will work fine.

EDIT: Just to be clear, if a function appear while in FRC mode, it will work.

Joe G. 11-03-2008 18:00

Re: A few basic EasyC Pro questions
 
Thank you very much, I had a feeling I was missing a "switch to FRC mode" button.

Joe G. 11-03-2008 18:49

Re: A few basic EasyC Pro questions
 
One more question: How would I control a relay using a joystick? I want it so that, when the joystick is pushed 50% in either direction, the relay turns on accordingly, but I cannot find a direct way to operate a relay with a joystick.

EHaskins 11-03-2008 19:09

Re: A few basic EasyC Pro questions
 
Quote:

Originally Posted by rocketperson44 (Post 716635)
One more question: How would I control a relay using a joystick? I want it so that, when the joystick is pushed 50% in either direction, the relay turns on accordingly, but I cannot find a direct way to operate a relay with a joystick.

Code:

#include "Main.h"

void OperatorControl ( void )
{
      unsigned char temp;

      temp = GetOIAInput ( 1 , 1 ) ;
      if ( temp > 192 )
      {
            SetRelay ( 1 , 1 , 0 ) ;
      }
      else if (  temp < 64 )
      {
            SetRelay ( 1 , 0 , 1 ) ;
      }
      else
      {
            SetRelay ( 1 , 0 , 0 ) ;
      }
}


whytheheckme 11-03-2008 21:18

Re: A few basic EasyC Pro questions
 
Quote:

Originally Posted by rocketperson44 (Post 716597)
-Do functions such as 2 motor arcade work with FRC?

Yes, there is 2 motor arcade, 4 motor arcade, and same with tank drive. Simply set your joystick ports and axis, and your PWM outputs (and maybe inverts if your drive isn't set up like in the picture.)
Quote:

Originally Posted by rocketperson44 (Post 716597)
-How do I add more than 2 reciever ports (four joysticks) (or is it all one port with a bunch of channels?)

When you go to use a function block that uses joysticks, you set the joystick port, and then the axis/button (depending on analog or digital)
Quote:

Originally Posted by rocketperson44 (Post 716597)
-Same with PWMs, relays.

All PWM and relays are accessible.
Quote:

Originally Posted by rocketperson44 (Post 716597)
-Do I need anything special in the initialize program?

I like to set my driver motors to 127, initialize my camera, etc. Nothing is required here.
Quote:

Originally Posted by rocketperson44 (Post 716597)
-Will the online window work with FRC?

Yep, the terminal window is the same.
Quote:

Originally Posted by rocketperson44 (Post 716597)
-I assume that the Vex USB converter will also work with FRC, am I correct?

Yep, USB to serial is USB to serial.
Quote:

Originally Posted by rocketperson44 (Post 716635)
One more question: How would I control a relay using a joystick? I want it so that, when the joystick is pushed 50% in either direction, the relay turns on accordingly, but I cannot find a direct way to operate a relay with a joystick.

You can directly operate a relay using BUTTONS on the joystick, using the OI to Relay command under the "RC Control" set. If you want it so that it works on the joystick axis, Eric's code is great.

[/quote]


All times are GMT -5. The time now is 11:30.

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