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


void loop() {
  
  if (millis() - time >= motor_time) analogWrite(motorPin, 0);
  
  if (!USB_connected) {
    for (int c = 0; c < 6; c++) {

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

int motorCount = 2;
int motorPulse = 2;
volatile int motorState = LOW;
boolean motorCommand = false;

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