|
|
@ -12,6 +12,8 @@ from scipy.io import wavfile |
|
|
|
# | |
|
|
|
# | |
|
|
|
# '-> 10k -> GND |
|
|
|
# '-> 10k -> GND |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
led = None |
|
|
|
|
|
|
|
|
|
|
|
def capture(tr): |
|
|
|
def capture(tr): |
|
|
|
now=datetime.datetime.now() |
|
|
|
now=datetime.datetime.now() |
|
|
|
now.isoformat() |
|
|
|
now.isoformat() |
|
|
@ -19,16 +21,20 @@ def capture(tr): |
|
|
|
print("Capture! ") |
|
|
|
print("Capture! ") |
|
|
|
print(data) |
|
|
|
print(data) |
|
|
|
np.save("lightning-%s"%now.isoformat(), data) |
|
|
|
np.save("lightning-%s"%now.isoformat(), data) |
|
|
|
|
|
|
|
led.pulse_ms(250, confirm=False) |
|
|
|
|
|
|
|
|
|
|
|
with gex.Client(gex.TrxRawUSB()) as client: |
|
|
|
with gex.Client(gex.TrxRawUSB()) as client: |
|
|
|
adc = gex.ADC(client, 'adc') |
|
|
|
adc = gex.ADC(client, 'adc') |
|
|
|
|
|
|
|
led = gex.DOut(client, 'led') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
adc.set_sample_rate(60000) |
|
|
|
|
|
|
|
|
|
|
|
adc.on_trigger(capture) |
|
|
|
adc.on_trigger(capture) |
|
|
|
adc.setup_trigger(1, |
|
|
|
adc.setup_trigger(1, |
|
|
|
level=500, |
|
|
|
level=2600, |
|
|
|
count=1000, |
|
|
|
count=5000, |
|
|
|
edge='rising', |
|
|
|
edge='rising', |
|
|
|
pretrigger=250, |
|
|
|
pretrigger=500, |
|
|
|
holdoff=500, |
|
|
|
holdoff=500, |
|
|
|
auto=True) |
|
|
|
auto=True) |
|
|
|
|
|
|
|
|
|
|
|