Hi,
I am trying to Radio control my stepper motor, at this stage using a simple sketch,
When I put the command "pinMode(7,INPUT);" (which will be used to read the signal from the Receiver of the radio)
into the "void Setup", the motor runs very rough, and does not rotate 360 degrees.
Without "pinMode (7,INPUT)" it runs perfectly
Would it have something to do with the fact that I might be running out of SRAM?
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.The motor should revolve one revolution in one direction, then
one revolution in the other direction.Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe*/
#include <Stepper.h>
int ch3; //channel 3 of the recieverconst int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 4,7,3,2); //changed for hbridgevoid setup() {
pinMode(7,INPUT); //make digital pin 7 an input//set the speed at 60RPM
myStepper.setSpeed(60);
// initialize the serial port:}
void loop() {
// step one revolution in one direction:
myStepper.step(stepsPerRevolution);
delay(500);}
Thanks
Mick