 void loop() {
   // Drive the main motor
   driveMotor();
+
+  //Light control
+  lights();
 }

//
void setup() {
  // Optional: Motor PWM frequency (Requires the PWMFrequency.h library)
/*setPWMPrescaler(motor1_pwm, 1); // 123Hz = 256,  492Hz = 64, 3936Hz = 8, 31488Hz = 1
  setPWMPrescaler(motor2_pwm, 1);*/
}

//

  // ***************** Note! The ramptime is intended to protect the gearbox! *******************
  // SYNTAX: Input value, max PWM, ramptime in ms per 1 PWM increment
  // false = brake in neutral position inactive
  if (Motor1.drive(speed1, 255, 7, false) ) { // Motor 1
    // returns true, if motor is running, so we can do other stuff here!
  }
  Motor2.drive(speed2, 255, 1, false); // Motor 2
}

//
// =======================================================================================================
// LIGHTS
// =======================================================================================================
//

void lights() {
  if (Motor1.brakeActive()) { // if braking detected from TB6612FNG motor driver
       //digitalWrite(BRAKELIGHTS, HIGH);
    }
    else {
      //digitalWrite(BRAKELIGHTS, LOW);
    }
}

//
