Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Help Programming Buttons (http://www.chiefdelphi.com/forums/showthread.php?t=64062)

LordFrz 14-02-2008 11:55

Help Programming Buttons
 
HY im trying to program our triggers to move the cylinders. I have used search and found most of what I need. But when i compile it says I must define my symbol p1_sw_trig and p2_sw_trig


Im using easy C

Can anyone help me please.

omalleyj 14-02-2008 12:36

Re: Help Programming Buttons
 
Those variables are not predefined in EasyC. You need to either define them as a local variable, if you are only using them in one function, or globally if you use it in several functions.
Most likely you want to have them available anywhere in the program, so define them globally. Press F6 to pop up the global variables section and add a variable to the list at the bottom. Probably you will want an 'unsigned char', as joysticks use 0-255, but you may want an 'int' if you plan to do math on the value and the variable may end up holding a negative value.

Mark McLeod 14-02-2008 12:43

Re: Help Programming Buttons
 
Quote:

Originally Posted by LordFrz (Post 698809)
... p1_sw_trig and p2_sw_trig
Im using easy C

The code you've been looking at is not what you need in EasyC.
A better place to post future questions about EasyC programming is in this sub-forum http://www.chiefdelphi.com/forums/fo...play.php?f=164

You use those variables if you are using MPLAB, so ignore and don't try to use them.

For EasyC use "OI to Relay" under "RC Control" to work your cylinders.
For example, to use the trigger from Joystick Port 2, and the solenoid relay connected to Relay 7, you'll end up with a line of code something like:
Code:

OIToRelay(2,1,7,1);
This example will put the cylinder in one position while the trigger is held, and another when it is not being held.

LordFrz 14-02-2008 13:55

Re: Help Programming Buttons
 
Thanks for the help yall.


All times are GMT -5. The time now is 00:55.

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