 #include <Me_InfraredReceiver.h>
 #include <Me_UltrasonicSensor.h>
 #include "MakeblockStepper.h"
+#include <AccelStepper.h>
 #include <Servo.h>
 #include <Me_ServoDriver.h>
 

Me_InfraredReceiver infraredReceiver; /* Note: As the code need to use interrupt 0, it works only when the Me - Infrared Receiver module is connected to the port 4(PORT_4) of Me - Base Shield. */
Me_UltrasonicSensor ultraSensor( PORT_5 ); //Ultrasonic module can ONLY be connected to port 3, 4, 5, 6, 7, 8 of base shield. ultraSensor.distanceCm()
MakeblockStepper moveItemStepper( 3200, baseShield, PORT_3 );
Me_ServoDriver servoDriver(PORT_2); //can ONLY be PORT_1,PORT_2

void setup() {
  // Initailize FSM

#define STATE_LOWER_TOP_FLAP 5
#define STATE_RELEASE_FLAP 6
#define STATE_RAISE_TOP_FLAP 7
#define STATE_MOVE_ITEM_OUT_PHASE_ONE 8
#define STATE_MOVE_ITEM_OUT_PHASE_TWO 9

int fsmState;

