 // 10 characters plus a null character 
 // so we can use it as a proper string.
 #define meterdisplaysize 10
-char meterdisplay[11] = 
-{ METER_CHAR_1,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_0,
-  METER_CHAR_1};
 
 int currentMeter = 0;
 

  currentMeter = currentMeter + ((sample - currentMeter) / nrSamples);
}

void buildMeterDisplayString() {
  int fullblocks = (currentMeter*meterdisplaysize)/1024;
  int lastchar  = ((currentMeter*meterdisplaysize)%1024)/3;
  for(int i=0; i<meterdisplaysize; i++){
    if (i<=fullblocks) {
      meterdisplay[i] = METER_CHAR_3;
    } else if (i==fullblocks+1) {
      switch(lastchar) {
        case 0: meterdisplay[i] = METER_CHAR_0;
        case 1: meterdisplay[i] = METER_CHAR_1;
        case 2: meterdisplay[i] = METER_CHAR_2;
      }
    } else {
      meterdisplay[i]=METER_CHAR_0;
    }
  }
}

void writeMeterDisplay(byte col, byte row) {
  lcd.setCursor(col,row);
  lcd.print(meterdisplay);
}


  }

  updateFilteredMeter(analogRead(SMETER));
  writeSMeter(0,0);

  nextMeterUpdate = nowmillis + meterUpdateMillis;
}
