No matter which expression I use, primary-expression before ; comes up

I'm working on a code that will allow stepper motors to be used with my Futaba Transmitter. Right up to this line below, and no matter what i do, which expression i use I get an expected primary-expression error.

C:\Users\pawly\OneDrive\Personal\Arduino\Tx_Rx_Stepper\Tx_Rx_Stepper.ino: In function 'void setup()':
C:\Users\pawly\OneDrive\Personal\Arduino\Tx_Rx_Stepper\Tx_Rx_Stepper.ino:35:42: error: expected primary-expression before ';' token
 for (int o Dir4,o MS18,pinMode;o++ Output;);
                                          ^

Assistance is appreciated, thank you.

I'm afraid that isn't anything close to valid C syntax, it's just words and symbols strung together.

1 Like

Hi van_der_decken, this is my defining,

//Define Pins
#define RCPin 2
#define Dir 4
#define STEP 5
#define MS3 6
#define MS2 7 
#define MS1 8
#define PulseTimer 
#define digitalPinToInterrupt
#define attachInterrupt
#define o
#define Output

does this make it better?

You really need to follow some tutorials.

None of what you’ve posted makes any sense.

You only have to write normal simple code:

const int RCPin = 2;
const int DirPin = 4;
const int StepPin = 5;
const int MS1Pin = 8;
const int MS2Pin = 7; 
const int MS3Pin = 6;

void setup() 
{
  pinMode(RCPin,INPUT);
  pinMode(DirPin, OUTPUT);
  pinMode(StepPin, OUTPUT);
  pinMode(MS1Pin, OUTPUT);
  pinMode(MS2Pin, OUTPUT);
  pinMode(MS3Pin, OUTPUT);
}

void loop() 
{
}
2 Likes

I will only echo what @lastchancename wrote: there are many excellent tutorials on the web which will teach you the basics of programming in C, and many that deal with the Arduino as well. I urge you to make use of one of them.

1 Like

Very helpful Koepel, thank you. So, if I am using 2 steppers I should put

pinMode(RCPin,INPUT1)
pinMode(RCPin,INPUT2)
[quote="Koepel, post:6, topic:1232052"]

void setup()
{
pinMode(RCPin,INPUT);
pinMode(DirPin, OUTPUT);
pinMode(StepPin, OUTPUT);
pinMode(MS1Pin, OUTPUT);
pinMode(MS2Pin, OUTPUT);
pinMode(MS3Pin, OUTPUT);
}

[/quote]


OP, please read the tutorials, and follow some of the examples in the IDE
Making up your own syntax is going to be a very long journey.

1 Like

Word. But how cool would it be to be able to say

  for (int o Dir4,o MS18,pinMode;o++ Output;);

and have that one line of code do whatever that's supposed to be doing?

a7

The question is…
What do you think it should be doing ?
You’re the only one !

Well, substituting in these wacky defines:

it translates to this nonsense:

for (int Dir4, MS18, pinMode; ++ ;);

No wonder the compiler complained.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.