Help!!! AccelStepper and IRremote code wont work

Hello

I am struggling to make my 28BYJ-48 stepper motor use the AccellStepper library and the IRremote library together. I am very new to programming and don't fully understand it. this is for a university project.

I only need it to go forward a set amount of steps when I press the up button on the tremote, and backwards a set amount when I press the down button.

I copied a sketch that uses both the stepper library and the IRremote library together and that works as far as coding is concerned however I'd like to replace the stepper library with the AccelStepper libabry as this is a much better library for my needs.

This is the original code below that works, it uses the Stepper and IRremote libraries. The code that follows after is my attempt the transplant the AccelStepper code into the Stepper codes place.

#include "Stepper.h"
#include "IRremote.h"

/----- Variables, Pins -----/
#define STEPS 32 // Number of steps per revolution of Internal shaft
int Steps2Take; // 2048 = 1 Revolution
int receiver = 6; // Signal Pin of IR receiver to Arduino Digital Pin 6

/-----( Declare objects )-----/
// Setup of proper sequencing for Motor Driver Pins
// In1, In2, In3, In4 in the sequence 1-3-2-4

Stepper small_stepper(STEPS, 8, 10, 9, 11);
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of 'decode_results'

void setup()
{
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
if (irrecv.decode(&results)) // have we received an IR signal?

{
switch(results.value)

{

case 0xFF629D: // UP button pressed
small_stepper.setSpeed(500); //Max seems to be 700
Steps2Take = 2048; // Rotate CW
small_stepper.step(Steps2Take);
delay(2000);
break;

case 0xFFA857: // DOWN button pressed
small_stepper.setSpeed(500);
Steps2Take = -2048; // Rotate CCW
small_stepper.step(Steps2Take);
delay(2000);
break;

}

irrecv.resume(); // receive the next value
}

}/* --end main loop -- */

The code that follows after is my attempt the transplant the AccelStepper code into the Stepper codes place....

#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

#include <AccelStepper.h>

#define FULLSTEP 4

int receiver = 6;

#define motorPin1 8 // Blue - 28BYJ48 pin 1
#define motorPin2 9 // Pink - 28BYJ48 pin 2
#define motorPin3 10 // Yellow - 28BYJ48 pin 3
#define motorPin4 11 // Orange - 28BYJ48 pin 4

AccelStepper stepper1(FULLSTEP, motorPin1, motorPin3, motorPin2, motorPin4);
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of 'decode_results'

void setup()
{
irrecv.enableIRIn(); // Start the receiver

}

void loop()
{
if (irrecv.decode(&results)) //

{
switch(results.value)

{

case 0xFF629D: stepper1.setMaxSpeed(530.0);
stepper1.setAcceleration(700.0);
stepper1.setSpeed(530);
stepper1.moveTo(3450);

case 0xFFA857: stepper1.setMaxSpeed(530.0);
stepper1.setAcceleration(700.0);
stepper1.setSpeed(530);
stepper1.moveTo(-3450);

}

irrecv.resume(); // receive the next value
}

}/* --end main loop -- */

Please could someone correct where i have gone wrong

Did you forget the breaks in the switch/case combined code ?

Hi, yes i have now tried it with the brakes, it still doesn't seem to move the motor