 void runWaitBtIndication() {
   if (millis() > (lastWaitIndicationUpdate + WaitIndicationInterval)) {
     lastWaitIndicationUpdate = millis();
-    digitalWriteFast(connectionLed, connectionLedStatus);
+    if(connectionLedStatus) {
+      analogWrite(connectionLed, ledOutputValue);
+    } else{
+      analogWrite(connectionLed, 0);
+    }
     connectionLedStatus = !connectionLedStatus;
   }
 }
 
 void runBatteryIndication() {
   // blink status led at known interval when battery is low.
-  if(lowBattery) {
-    if (millis() > (lastBatteryIndicationUpdate + WaitBatteryInterval)) {
-      lastBatteryIndicationUpdate = millis();
-      digitalWriteFast(teensyLed, teensyLedStatus);
-      teensyLedStatus = !teensyLedStatus;
-    }
+    if (batteryLow) {
+      if(batteryLedStatus) {
+        analogWrite(batteryLed, ledOutputValue);
+      } else {
+        analogWrite(batteryLed, 0);
+      }
+      batteryLedStatus = !batteryLedStatus;
   }
 }
 


  // I/O directions
  pinMode(btStatus, INPUT);
  pinMode(teensyLed, OUTPUT);
  pinMode(connectionLed, OUTPUT);

  // wake-up blinking
  digitalWriteFast(connectionLed, HIGH);
  digitalWriteFast(teensyLed, HIGH);
  delay(1000);
  digitalWriteFast(connectionLed, LOW);
  digitalWriteFast(teensyLed, LOW);
  delay(1000);
  digitalWriteFast(teensyLed, HIGH);
  
  // set led status
  teensyLedStatus=true;
  
  // set all joystick things to known positions
  Joystick.useManualSend(true); // enable this to get simultaneous button presses if needed
  Joystick.X(512);            // "value" is from 0 to 1023

	0 serial rx
	1 serial tx
	2 bluetooth status
  22 battery warning led
  23 power /connection status led
*/

// used pin definitions
#define btStatus 2
#define batteryLed 22
#define connectionLed 23

// define led brighness here in percentage
#define LED_BRIGHTNESS 5
// for 82-100 ohm series resistor and small 3mm red/green through-hole
// led, 5 % seems fine.
#define ledOutputValue 255*LED_BRIGHTNESS/100

// some status variables
boolean batteryLow = false;
byte batteryLedStatus = 0;

boolean btConnected = false;
byte connectionLedStatus = 0;



long const int WaitIndicationInterval = 200;
unsigned long int lastWaitIndicationUpdate = 0;
