 
   ( preferences.getString( "tftorientation", "normal" ) == "normal" ) ? tftOrientation = TFT_ORIENTATION_NORMAL : tftOrientation = TFT_ORIENTATION_UPSIDEDOWN;
   tft.setRotation( tftOrientation );
-  while ( !xDimmerTaskHandle )
-  {
-    vTaskDelay( 10 / portTICK_PERIOD_MS );
-  }
+
+  while ( !xDimmerTaskHandle ) vTaskDelay( 10 / portTICK_PERIOD_MS );
+
   ledcWrite( TFT_BACKLIGHT_CHANNEL, 0 );
 
-  while (1)
-  {
-    switch ( tftState )
-    {
-      case normal:
+  while (1) {
+    switch ( tftState ) {
+      case normal: {
         showStatus();
         break;
-
-      case menu:
+      }
+      case menu: {
         showMenu();
         break;
-
+      }
       default:
         break;
     }

const uint16_t BL_SLIDER_HEIGHT = 160;

/* area to check for touch to control backlight */
const tftButton::button_t BL_SLIDER_AREA
{
  BL_SLIDER_XPOS - BL_SLIDER_WIDTH / 2, BL_SLIDER_YPOS, BL_SLIDER_WIDTH, BL_SLIDER_HEIGHT, 0, 0, ILI9341_YELLOW, size0, "", "back light"
};

/* buttons used on main screen */
const tftButton::button_t MENU_BUTTON
{
  210, 10, TFT_BUTTON_WIDTH, TFT_BUTTON_HEIGHT, ILI9341_BLUE, ILI9341_YELLOW, ILI9341_YELLOW, size0, "MENU"
};

tftButton::button_t tempArea[MAX_NUMBER_OF_SENSORS];

  }
}

void newSensors() {
  tft.startWrite();
  tft.writeFillRect( 210, 60, TFT_BUTTON_WIDTH, 120, TFT_BACK_COLOR );
  tft.endWrite();

  sensorName_t name;
  for ( uint8_t num = 0; num < logger.sensorCount(); num++ ) {
    tempArea[num].x = 220;
    tempArea[num].y = 70 + num * 40;
    tempArea[num].w = TFT_BUTTON_WIDTH - 20;
    tempArea[num].h = 30;
    tempArea[num].color = TFT_BACK_COLOR;
    tempArea[num].labelcolor = ILI9341_WHITE;
    tempArea[num].fontsize = LARGE;
    button.updateSensorLabel( tempArea[num], logger.getSensorName( num, name ) );
  }
}

void showStatus() {
  const uint16_t BARS_BOTTOM      = 190;
  const uint16_t BARS_HEIGHT      = BARS_BOTTOM - 10;
  const uint16_t BARS_BORDER      = 12;
