lightnings demo improv

master
Ondřej Hruška 7 years ago
parent 5f3e47bcaa
commit 7e9f6f1c3c
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 12
      demo_adc_lightnings.py

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

Loading…
Cancel
Save