updated some test scripts
This commit is contained in:
+6
-3
@@ -14,21 +14,24 @@ with gex.Client(gex.TrxRawUSB()) as client:
|
||||
print(adc.get_channels())
|
||||
|
||||
adc.set_active_channels([1])
|
||||
rate=500
|
||||
rate=50000
|
||||
fs = adc.set_sample_rate(rate)
|
||||
|
||||
count = 2000
|
||||
time.sleep(0.1)
|
||||
count = 5000
|
||||
data = adc.capture(count)
|
||||
|
||||
print("rx, %d samples" % len(data))
|
||||
data = np.add(data / 4096, -0.5)
|
||||
|
||||
adc.set_sample_rate(1000)
|
||||
|
||||
#
|
||||
if data is not None:
|
||||
# wavfile.write('file.wav', rate, data)
|
||||
# print("Ok")
|
||||
|
||||
plt.plot(data, 'r.', lw=1)
|
||||
plt.plot(data, 'r-', lw=1)
|
||||
plt.show()
|
||||
else:
|
||||
print("Nothing rx")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/env python3
|
||||
import time
|
||||
|
||||
import gex
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
from scipy.io import wavfile
|
||||
|
||||
with gex.Client(gex.TrxRawUSB()) as client:
|
||||
adc = gex.ADC(client, 'adc')
|
||||
|
||||
for i in range(1000):
|
||||
print(adc.read_raw())
|
||||
|
||||
+7
-4
@@ -24,11 +24,14 @@ with gex.Client(gex.TrxRawUSB()) as client:
|
||||
# #
|
||||
# dac.sync()
|
||||
|
||||
for i in range(0, 1000):
|
||||
dac.set_frequency(1, i)
|
||||
time.sleep(0.001)
|
||||
|
||||
# for i in range(0, 1000):
|
||||
# dac.set_frequency(1, i)
|
||||
# time.sleep(0.001)
|
||||
|
||||
dac.waveform(1, 'SIN')
|
||||
dac.set_frequency(1, 1000)
|
||||
time.sleep(2)
|
||||
dac.dc(1, 2047)
|
||||
|
||||
# dac.waveform(1, 'SIN')
|
||||
# # dac.set_frequency(1, 1000)
|
||||
|
||||
Reference in New Issue
Block a user