Producures in Arduino

Hi all, what is the structure for wirint g a producure in arduino?

I want something like:

procedure1(){ if(X=Y) then OUTPUT end if }

but not sure of the structure. I want to be able to call the procedure using something like

procedure1()

could someone tell me the correct way of doing this?

Thanks Rob

hehe well it isnt a procedure its called a function you need to do something like this

void procedure()
{
the PROCEDURE
}

in void loop
void loop()
{
procedure();
}

and first time i saw this post ti thought this was something new because of the werid post name procedures ;D

procedure1()
{
  if (X[glow]==[/glow]Y)   // Note the double == is a compare, the single = is a assignment
  {
    Serial.println("X equals Y "); // or ...
  }
}

Check the codes in the tutorial section - http://arduino.cc/en/Tutorial/HomePage = Spending time there is not waited as you can learn an awfull lot about the coding of the Arduino.

In C/C++, the term is function, not procedure, though they mean similar things. One thing that newbie and robtillaart left out (not intentionally, I'm sure), but that you must not, is the return type for the function.

All functions must have a return type defined. If the function returns nothing, its return type is void, but that must still be explicitly called out.

[glow]void[/glow] procedure1()
{
  if (X==Y)   // Note the double == is a compare, the single = is a assignment
  {
    Serial.println("X equals Y "); // or ...
  }
}