Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Variable assignment in EasyC (http://www.chiefdelphi.com/forums/showthread.php?t=62944)

Hieb 31-01-2008 12:05

Variable assignment in EasyC
 
I usually use MPLAB for programming, but since I was teaching complete beginners this year I decided to use EasyC instead. My question is this: How can I assign a value from the OI to a variable in EasyC. For example, in MPLAB I would make a statement like

myVariable = p1_y;

or

myVariable = pwm01;

I know how to use the assignment block to assign specific values to a variable, and I know how to use the OIToPWM block, but I want to take the pwm value and assign it to a variable.

Thanks.

Mark McLeod 31-01-2008 13:42

Re: Variable assignment in EasyC
 
Creat a variable (double click on "Variables").

To make the assignment:
Under "RC Control" use "Analog OI Input" or "Digital OI Input"

e.g.,

Code:

unsigned char x;
 
x = GetOIAInput(1,1);



All times are GMT -5. The time now is 23:45.

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