Hi guys,
First post and first time Arduino user. I am trying to use 2 brushless motors with ecs for each one with a remote control unit from an old rc car.
I have not seen anyone try this and am not sure what I am doing.
Here are the pins I am using and what they are connected to:
pin A0 - input from R/C receiver
+5v - power to R/C receiver
GND - to GND R/C receiver
pin 5 -white to Ecs1
pin 6 -red to ecs1
pin 9 -white to ecs2
pin 10 -red to ecs2
Here is my code:
#include <Stepper.h>
#define STEPS 100
Stepper stepper_left(STEPS, 5, 6);
Stepper stepper_right(STEPS, 10, 11);
int sensorPin = A0;
int sensorValue = 0;
int previous = 0;
void setup()
{
stepper_left.setSpeed(30);
stepper_right.setSpeed(30);
}
void loop()
{
sensorValue = analogRead(sensorPin);
int val = analogRead(0)
|analogRead(0)|
stepper_left.step(val - previous);
stepper_right.step(val - previous);
previous = val;
}
I am getting the, void value not ignored as it ought to be at:
stepper_left.step(val - previous);
I am not sure what the problem is. Any help would be appreciated.