updated some test scripts

This commit is contained in:
2018-04-16 14:19:40 +02:00
parent 91a8269e98
commit c15658e6ad
3 changed files with 28 additions and 7 deletions
+6 -3
View File
@@ -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")
+15
View File
@@ -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
View File
@@ -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)