trying to convert raw values

what is wrong

light_sensor_raw_values.ino (261 Bytes)

Make X global.

I think you tried something like this (the x stuff was wrong and superfluous IMHO)

const byte touchPin = 9;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  pinMode(touchPin, OUTPUT);
  digitalWrite(touchPin, HIGH);
  delayMicroseconds(12);
  pinMode(touchPin, INPUT);
unsigned long time = micros();
  while (digitalRead(touchPin)) {}
  Serial.println(micros() - time);
}

here are two programs that i have made with your help thanks!

QTR_1RC_Program_1.ino (299 Bytes)

QTR_1RC_Program_2.ino (1.79 KB)