I need help with my cases with an RF controller

This is what I'm trying to do. I don't want to input the same command twice so I am trying make it so I can't. Here's my messed up code. Please help.

//www.elegoo.com
//2016.12.12

#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 = 12; // Signal Pin of IR receiver to Arduino Digital Pin 6
int lastCommand=0;
/-----( 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 1: 0xFFA857:; // VOL+ button pressed
check; if (lastCommand==1);
small_stepper.setSpeed(500); //Max seems to be 500
Steps2Take = 512; // Rotate CW
small_stepper.step(Steps2Take);
delay(2000);
lastCommand=1;
break;

{
case 2: 0xFF629D: ; // VOL- button pressed

check if (lastCommand==2);
small_stepper.setSpeed(500);
Steps2Take = -512; // Rotate CCW
small_stepper.step(Steps2Take);
delay(2000);
(lastCommand=2);
break;

}
}
irrecv.resume(); // receive the next value
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
}

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

ERROR CODES

Arduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\name\AppData\Local\Temp\arduino_modified_sketch_950187\With_Remote.ino: In
function 'void loop()':

With_Remote:35: error: expected ';' before ':' token

case 1: 0xFFA857:; // VOL+ button pressed

^

With_Remote:36: error: 'check' was not declared in this scope

check; if (lastCommand==1);

^

With_Remote:47: error: expected ';' before ':' token

case 2: 0xFF629D: ; // VOL- button pressed

^

With_Remote:49: error: expected ';' before 'if'

check if (lastCommand==2);

^

Multiple libraries were found for "IRremote.h"
Used: C:\Users\Sevveek\Documents\Arduino\libraries\IRremote
Not used: C:\Program Files (x86)\Arduino\libraries\RobotIRremote
exit status 1
expected ';' before ':' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

case 1: 0xFFA857:; // VOL+ button pressed

google case statement C++ and you will see wha't wring with your syntax there.

This compiles.

//www.elegoo.com
//2016.12.12

#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 = 12; // Signal Pin of IR receiver to Arduino Digital Pin 6
int lastCommand = 0;
/*-----( 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 1: 0xFFA857:; // VOL+ button pressed
      case 0xFFA857: // VOL+ button pressed
        //check; if (lastCommand==1);
        if (lastCommand == 1) {
          small_stepper.setSpeed(500); //Max seems to be 500
          Steps2Take  =  512;  // Rotate CW
          small_stepper.step(Steps2Take);
          delay(2000);
          lastCommand = 1;
          break;



          // {
        }
      // case 2:   0xFF629D: ; // VOL- button pressed
      case 0xFF629D: // VOL- button pressed

        // check if (lastCommand == 2);
        if (lastCommand == 2) {
          small_stepper.setSpeed(500);
          Steps2Take  =  -512;  // Rotate CCW
          small_stepper.step(Steps2Take);
          delay(2000);
          (lastCommand = 2);
          break;

        }
    }
    irrecv.resume(); // receive the next value
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
  }


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

See the commented lines.

 case 1: 0xFFA857:; // VOL+ button pressed

should be

case 0xFFA857: // VOL+ button pressed

On lines like this

       check; if (lastCommand==1);

not sure where that check came from but it should be

       if (lastCommand == 1) {

There was also a left curly brace that should have been a right curly brace.

If you want to EXCLUDE a repeat, the tests should be like "if (lastCommnd != 1) {", otherwise only repeats are allowed.

#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 = 12; // Signal Pin of IR receiver to Arduino Digital Pin 6
int lastCommand = 0;
/*-----( 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 0xFFA857: // VOL+ button pressed
        if (lastCommand != 1) {
          small_stepper.setSpeed(500); //Max seems to be 500
          Steps2Take  =  512;  // Rotate CW
          small_stepper.step(Steps2Take);
          delay(2000);
          lastCommand = 1;
        }
        break;

      case 0xFF629D: // VOL- button pressed
        if (lastCommand != 2) {
          small_stepper.setSpeed(500);
          Steps2Take  =  -512;  // Rotate CCW
          small_stepper.step(Steps2Take);
          delay(2000);
          lastCommand = 2;
        }
        break;

    } // end switch (results.value)
    
    irrecv.resume(); // receive the next value
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
  }  // end if (irrecv.decode(&results))

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

I will test this tonight! Thank you!