Änderungen

Aus Hackerspace Ffm
Wechseln zu: Navigation, Suche

LineCamPrinter

11 Byte entfernt, 23:34, 9. Feb. 2019
/* Details of operation */
As long as the camera is running, the line sensor is read-out all the time. This is done line-by-line in the following steps:
0. # TSL1401_Init(int32_t ExposeDuration, int32_t ExposePeriod): The TSL1401 is initialized by clocking in 170 clocks. Two delayed interrupts are now started in a way that they will be triggered exactly in the preferred frequency (period) and with a gap between that defines the exposure time. The period should set to match 2 times the mains frequency as most lights in the room are flickering that way and otherwise disturbing the image if not synced to it. For Europe 100 Hz is used here - this is 10,000 us or 10ms.  1. # TSL1401_PrepareExpose() is used to generate 17 additional clocks and prepare for exposure.  2. # TSL1401_StartExpose(): The first interrupt will come and starts the exposure by clocking in 115 more clocks. The sensor is now light sensitive and the pixel line is going to charged up by the light coming in. 3. # TSL1401_StopExpose(): The second interrupt will come and will stop the exposure by clocking in a few more clocks. 4. # TSL1401_ReadLine(): The analog values of the pixels can now be shifted out and read by the ADC. This is done using the ADC.h from Teensy to do it in very high speed. The minimum and maximum pixel values of the line will be determined and averaged over several line readings. These are used to bring the picture data to an always maximum contrast by mapping with the min and max data. 5. # After read-out, the process starts again at 12.
== Code ==
https://github.com/hackffm/LineCamPrinter
1.954
Bearbeitungen