can some one tell me what the differance is between the == and the = symbols?

Sure! The “==” is a logical comparison. The expression A == B returns “true” if the variables A and B are the same value, and “false” if they are not. The “=” assigns the value on the right to the variable on the left. For example, A = 120 would result in the variable “A” containing the value “120.”

Does that make sense to you?

makes sence…exept for one thing…if i used A = 120, do i need to set A as a variable? sounds to me like i do, and if so can i use a user code block to preset variables?

I haven’t used Easy C in a while, but in RobotC you generally set the variable type like this:



int DriveLeftValue;
int ArmLiftValue;

Or , if you want to set an initial value,

int VARIABLENAME = initialvalue;


int DriveLeftValue = 0;
int ArmLiftValue = 0;

I’m afraid I don’t know enough about Easy C to give you any help, but somewhere in the code the variables are being set to a type.

i know how to set the variables, what i need to know is if i can use this to PREset variables.

With the EasyC interface, there’s a column for variable type, name, value and description or something along those lines. Input something into the value column

yes you should be able to. The type would probably be integer.

‘C’ is ‘C’ is ‘C’

EasyC creates ‘C’ code that is submitted to the MCC18 compiler. The same compiler that is used with the MPLAB IDE.

From what I can determine, Robot-C has its own compiler. But it all works the same way.

Do you want to know if you can Initialize a Variable when it is Declared??

YES (See Programming in C, Defining Global Variables.)

The Initialization will work at any point in your program, that the Variable is in Scope.

Most C Compilers will by default Initialize Global Variables to 0 (Zero) or NULL for char arrays, but Automatic Variables are left undefined. Which means, that if these Automatic Variables are read before having been Initialized, you will get a Garbage Value, which is very likely to do your Program No Good.

Download and read “JSF Air Vehicle - C++ Coding Standards (Revision C)” for some Really Good programming tips. :wink: (This document courtesy of Lockheed Martin Corporation, The United States Department of Defense, and the U.S. Tax Payer)

Awesome! I needed this!!!