   }
 }
 
-#define DEADZONE 5
+#define DEADZONE 2
 void readAllAnalogs() {
   uint16_t scaledValue;
   for(int i=0;i<64;i++) {
     write_analog_address(i);
     delayMicroseconds(50);
     scaledValue = analogRead(A0);
-    if(i==0) scaledValue = map(scaledValue,110,235,255,0);
-    else if(i==1) scaledValue = map(scaledValue,5,367,255,0);
-    else if(i==2) scaledValue = map(scaledValue,96,1170,0,255);
-    else if(i==3) scaledValue = map(scaledValue,40,140,255,0);
-    else scaledValue = map(scaledValue,0,211,255,0);
-    if(scaledValue>60000) scaledValue=0;
-    if(scaledValue>255) scaledValue=255;
-    scaledValue=(scaledValue*NEW_NUM_WEIGHT + (OLD_NUM_WEIGHT-NEW_NUM_WEIGHT)*analogValues[i])/OLD_NUM_WEIGHT;
-    if((scaledValue>analogValues[i]+DEADZONE && analogValues[i]<255-DEADZONE) || (scaledValue<analogValues[i]-DEADZONE && analogValues[i]>DEADZONE)) {
+    if(i==0) scaledValue = constrain(map(scaledValue,ME1_bottom,ME1_top,0,255),0,255);
+    else if(i==1) scaledValue = constrain(map(scaledValue,ME2_bottom,ME2_top,0,255),0,255);
+    else if(i==2) scaledValue = constrain(map(scaledValue,joystick_bottom,joystick_top,0,255),0,255);
+    else if(i==3) scaledValue = constrain(map(scaledValue,joystick_left,joystick_right,0,255),0,255);
+    else scaledValue = map(scaledValue,0,960,255,0);
+
+    if(i<2 && (scaledValue==255 || scaledValue==0)) {
+      // We need to acctually show the 0/255 for T bars
+    }
+    else {
+      scaledValue=(scaledValue*NEW_NUM_WEIGHT + (OLD_NUM_WEIGHT-NEW_NUM_WEIGHT)*analogValues[i])/OLD_NUM_WEIGHT;
+    }
+    
+    if((scaledValue>analogValues[i]+DEADZONE && analogValues[i]<255-DEADZONE) || (scaledValue<analogValues[i]-DEADZONE && analogValues[i]>DEADZONE) || ((analogValues[i]!=scaledValue) && (scaledValue==0 || scaledValue==255))) {
       analogValues[i] = scaledValue;
       if(booting) continue;
       Serial.print("a");Serial.print(i);Serial.print(",");Serial.println(scaledValue);

        case '!':
          resetFunc();
        case '~':
          Serial.println("Analog Calibrate mode");
          storeandclearLamps();
          Serial.println("Waiting...");
          waitSerial();
          restoreLamps();
          break;
      }
    }


void setup() {
  Serial.begin(115200);
  randomSeed(analogRead(A1));
  
  pinMode(WRITE,OUTPUT);
  pinMode(READ, OUTPUT);
