 
   dispLed(0x01, 0xff0, 0);      // 0 - yellow BLE setup
 
-// *********** BLE **************************************
+// *********** BLE Setup **************************************
   /* Set a local name for the BLE device
      This name will appear in advertising packets
      and can be used by remote devices to identify this BLE device

    else {
      stillMillis = millis() - stillBegin;
      if (stillMillis > 250) {
        int a = vraw[0]>>8;
        int b = vraw[1]>>8;
        int c = vraw[2]>>8;
        unsigned char roll=0;
        if (a>0x1d && a<0x3d && b>-10 && b<13 && c>0x12 && c<0x32)
          {roll=1; dispLed(0x1,0x0f0, 30);}
        else if (a>0x13 && a<0x37 && b>-13 && b<13 && c>(signed char)0xb3 && c<(signed char)0xd6)
          {roll=2; dispLed(0x3, 0x0f0, 30);}
        else if (a>(signed char)0xee && a<10 && b>(signed char)0xb1 && b<(signed char)0xd1 && c>(signed char)0xe6 && c<10)
          {roll=3; dispLed(0x7, 0x0f0, 30);}
        else if (a>(signed char)0xed && a<10 && b>0x30 && b<0x50 && c>(signed char)0xeb && c<10)
          {roll=4; dispLed(0x17, 0x0f0, 30);}
        else if (a>(signed char)0xc5 && a<(signed char)0xe0 && b>-10 && b<10 && c>0x1a && c<0x36)
          {roll=5; dispLed(0x37, 0x0f0, 30);}
        else if (a>(signed char)0xbb && a<(signed char)0xdb && b>-10 && b<10 && c>(signed char)0xbb && c<(signed char)0xdb)
          {roll=6; dispLed(0x77, 0x0f0, 30);}
        if (roll!=0 && !rollSent)
        {
          diceRollCharacteristic.setValue((diceId << 4) | roll);
          rollSent = true;
        }
      }
    }
  }
  else stillMillis=0;
  
  SERIAL_PRINT(movement);
  SERIAL_PRINT("\t");

  blePeripheral.setEventHandler(BLEConnected, connectHandler);
  blePeripheral.setEventHandler(BLEDisconnected, disconnectHandler);
  diceCommandCharacteristic.setEventHandler(BLEWritten, commandHandler);
  blePeripheral.begin();
  SERIAL_PRINTLN("Bluetooth device active, waiting for connections...");

  dispLed(0x01, 0x0f0, 500);      // 0 - green BLE setup done

  dispLed(0x02, 0xff0, 500);      // 1 - yellow IMU setup

  // *************** IMU Setup ***************************************
  // initialize device
  SERIAL_PRINTLN("Initializing IMU device...");
  CurieImu.initialize();
