     }
     
     if (inputString[inputString.length()-1] == ']') {
-      analogWrite(motorPin, 200);
+      motorState = HIGH;
+      motorCommand = true;
+      digitalWrite(motorPin, motorState);
+      motorPulse -= 1;
       time = millis();
     }
     

boolean stringComplete = false;
boolean USB_connected = false;
unsigned long time = 0;

void setup() {
  //set pins to output so you can control the shift register

int dataPin = 4;

int motorPin = 5;
long motor_on = 200; //number of milliseconds the motor vibrates
long motor_off = 100; //pause between pulses

int buttonPin = 2;

