aboutsummaryrefslogtreecommitdiff
path: root/test_rfGenLMX2487.py
blob: e87ad7985fc04b393bc24c55c823b659af0b2702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from rfGen import rfGenLMX2487
import numpy as np
import platform

if platform.system() == 'Linux':
    rf=rfGenLMX2487(port='/dev/ttyUSB0', speed=115200, timeout=1)
else:
    rf=rfGenLMX2487(port='COM5', speed=115200, timeout=1)

freqStart = 6.830e9
freqStop  = 6.840e9
Np = 21
print(f'We will sweep frequency from {freqStart} to {freqStop} in {Np} points')
for freq in np.linspace(freqStart,freqStop, num=Np, endpoint=True):
    print(f'Frequency set to {freq:.2f}') 
    rf.setFreq(freq)

print("Printing log")
print(rf.log2str())