Go Down

Topic: Arduino Code for TSL 1401 - DB ( TSL1401) Linescan (Read 7683 times) previous topic - next topic

kg1

I have written a function for the TSL1401 linescan camera:
Code: [Select]

void getCamera()
{
 digitalWrite(clockPin, LOW);
 pinMode(syncPin, OUTPUT);
 digitalWrite(syncPin, HIGH);
 digitalWrite(clockPin, HIGH);
 digitalWrite(syncPin, LOW);
 utime = micros();
 digitalWrite(clockPin, LOW);
 for (int j = 0; j < 128; j++)
   {
   digitalWrite(clockPin, HIGH);
   digitalWrite(clockPin, LOW);
   }
 delayMicroseconds(expose);
 digitalWrite(syncPin, HIGH);
 digitalWrite(clockPin, HIGH);
 digitalWrite(syncPin, LOW);
 utime = micros() - utime;
 digitalWrite(clockPin, LOW);
 for (int j = 0; j < 128; j++)
   {
   delayMicroseconds(20);
   lightVal[j] = analogRead(dataPin);
   digitalWrite(clockPin, HIGH);
   digitalWrite(clockPin, LOW);
   }
 delayMicroseconds(20);
 for (int j = 0; j < 128; j++)
   {
   itoa(lightVal[j], 'S');
   }
 itime = (int)utime;
 itoa(itime, 'S');
}


The full code is attached here: http://www.robotshop.com/forum/showthread.php?614-Xbee-Series-2-Point-to-Point-Duplex-Configuration

I am interested in any comments about the code and the timing of the pulses for a one-shot scan.

If you have written Arduino code for the TSL1401 please please reply and let us know your progress.

Many thanks
Kevin

Go Up