Go to Post Blue shirts are ALWAYS watching. And they have spies everywhere. Always be on your best behavior, and be polite to every volunteer at the event. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2008, 12:05
Hieb Hieb is offline
Registered User
no team
Team Role: Teacher
 
Join Date: Mar 2004
Rookie Year: 2004
Location: St. Louis, MO
Posts: 125
Hieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to behold
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.
  #2   Spotlight this post!  
Unread 31-01-2008, 13:42
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,721
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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);
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 31-01-2008 at 13:47.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC Assignment rules jonboy Programming 4 28-01-2008 16:36
MS Vista/EasyC & EasyC Pro rswsmay Programming 1 25-04-2007 10:47
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12


All times are GMT -5. The time now is 09:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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