   init_vars();
 }
 
+
+void run_brightness_curve() {
+  int i;
+  long t;
+  short v;
+  digitalWrite(DEBUG_LED2, HIGH);
+  for (i = 0; i < 1000; i++) {
+    v = analogRead(PD_SCREEN_PIN);
+    t = time_us;
+    Serial.print(t);
+    Serial.print(" ");
+    Serial.println(v);
+    delayMicroseconds(450);
+  }
+  digitalWrite(DEBUG_LED2, LOW);
+  Serial.send_now();
+  Serial.println("end");
+  Serial.send_now();
+}
 
 void process_command(char cmd) {
   int i;

void setup() {
  pinMode(LED_PIN_RED, OUTPUT);
  pinMode(LED_PIN_GREEN, OUTPUT);
  pinMode(LED_PIN_YELLOW, OUTPUT);
  pinMode(LED_PIN_INT, OUTPUT);

  pinMode(TOUCH_PIN_A, OUTPUT);

// for most LEDs.
#define LED_PIN_GREEN 16
#define LED_PIN_RED 17
#define DEBUG_LED2 21

// Pins for the relay based touch probes, collide with LEDs above
#define TOUCH_PIN_A 16
