Sub-routine header "not decalred in this scope"


Have started to play with a stepper motor using the arduino stepper library and millis. I have a subroutine “moveStepper” which I want to include in the void loop via a header. Problem is when I run the code I get “moveSteeper not decalred in this scope”. It references the movestepper header in the loop function. How do I declare a subroutine? PS Ignore the code in the moveStepper.


#include <Stepper.h>

const int stepsPerRevolution = 32;  // change this to fit the number of steps per revolution of motor

Stepper Stepper1(stepsPerRevolution, 8, 9, 10, 11); //Initialise your stepper motor on pins 8-11

unsigned long previousMillis = 0;        // will store last time LED was updated
unsigned long currentMillis = 0;
const long stepinterval = 30;           // interval at which to take a step

void setup() {

  Stepper1.setSpeed(60); //sets the speed of the motor in rpm


void loop() {

  currentMillis = millis();

void moveStepper(); {

  if (currentMillis - previousServoMillis >= stepinterval) {

    previousServoMillis += stepinterval;


void moveStepper(); {

Should be

void moveStepper(){

void moveStepper();

Change to:

void moveStepper()

Awesome - I should have picked that up. Thanks! :slight_smile: