For my detector I was advised by blmorris to use one of the AMS (formerly TAOS) linear sensors. I decided to go with TSL 1410R (http://ams.com/eng/Products/Light-Senso ... s/TSL1410R ). Unfortunately, I couldn't find any information how to read data from this sensor, so I put together some pieces of code from different places written for similar sensor using Arduino board. I tried to transfer the arduino code to pyboard. This is what I got:
Code: Select all
import pyb
from pyb import Pin, ADC
exposure_time = 5
pin_si = Pin('X1', Pin.OUT_PP)
pin_clk = Pin('X2', Pin.OUT_PP)
pin_ao = ADC(Pin('X3'))
def clock_pulse():
pin_clk.high()
pin_clk.low()
def write_pin_si():
pin_si.high()
clock_pulse()
pin_si.low()
def read():
write_pin_si()
for i in range(1281):
clock_pulse()
pyb.delay(exposure_time)
write_pin_si()
data = [pin_ao.read()* 3.3/4096 for i in range(1280)]
return data
data = read()
print(data)
Thank you for you time,
Vitali