comands

Okay this is a simple little fix.

Right now you have a function that takes in a variable before it runs. The syntax for functions like this is
armdrive (variable);

rather than armdrive = variable;

parenthesis in programming just surround things so that the computer knows what it is taking in

(variable) means take in variable to function
If you want to learn more about how these work you can read here.
http://www.robotc.net/education/curriculum/vex/pdfs/Functions.pdf

Just to elaborate on Tabor’s response:

void armDrive( char speed ***)***
{
	motor[leftArm] = speed;
	motor[leftArm2] = speed;
	motor[rightArm] = speed;
	motor[rightarm2] = speed;
}

task main()
{
// Arm Control
	if(vexRT[Btn5U])
		armDrive ***(***127***)***;
		
	else if(vexRT[Btn5D])
		armDrive***(***-127***)***;
	
	else
		armDrive***(***0***)***; 
}

The compiler gets confused by the hanging parenthesis when creating the function armDrive. I think the compiler caught it and fixed it, though.

All of the other edits I made were not important* to functionality of the program.

EDIT:
Also, this code will only run once and won’t give you any usable control, you’ll need to put in an infinite loop so it will run forever.


task main()
{
   while(true)
   {
      // Insert Code Here!
   }
}

There are 2 problems with your code. First in your armDrive function you need a ) after int speed.

corrected code:

void armDrive( int speed **)**
{
motor[leftArm] = speed;
motor[leftArm2] = speed;
motor[rightArm] = speed;
motor[rightarm2] = speed;
}

when you call a function you call it as function name(param 1, param2…)
EDIT:also remember to have your user code in a while loop or it will only run once

corrected code

task main
{
**while(true)
{**
// Arm Control
if(vexRT[Btn5U] == 1 )//if button 6U is pressed the flap will go up
{
armDrive**(127);**
}
else
if(vexRT[Btn5D] == 1 )
{
armDrive**(-127);**
}
else
{
armDrive**(0); **
}
**}**
}

also remember to use code tags when you post code

Ohhhhh so i just need those ( ) instead of an equal sign, right?
I’ll see if that works.

There was a ) after the int speed in my code, it just got lost when I copy and pasted my code on to the forum.

OK it worked thanks for explaining it to me.