File tree Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/python3
2
+
3
+ ##-------------------------------------------------------------------------------\
4
+ # tinySA_python
5
+ # './examples/using_autoconnect.py'
6
+ # This is a visual comparison of SCAN and SCANRAW to work out some errors in
7
+ # the decode process given that the tinySA is still running during the read,
8
+ # we don't expect SCAN and SCANRAW to be exactly the same, but they
9
+ # should be relatively similar values when SCANRAW is decoded
10
+ #
11
+ # Last update: June 18, 2025
12
+ ##-------------------------------------------------------------------------------\
13
+
1
14
# import tinySA library
2
15
# (NOTE: check library path relative to script path)
3
16
from src .tinySA_python import tinySA
4
17
5
18
# create a new tinySA object
6
19
tsa = tinySA ()
7
20
21
+ # set the return message preferences
22
+ tsa .set_verbose (True ) #detailed messages
23
+ tsa .set_error_byte_return (True ) #get explicit b'ERROR' if error thrown
24
+
25
+
8
26
# attempt to autoconnect
9
27
found_bool , connected_bool = tsa .autoconnect ()
10
28
11
29
# if port found and connected, then complete task(s) and disconnect
12
- if connected_bool == True : # or if success == True:
30
+ if connected_bool == True :
13
31
print ("device connected" )
14
- tsa .set_verbose (True ) #detailed messages
15
- tsa .set_error_byte_return (True ) #get explicit b'ERROR' if error thrown
32
+
16
33
msg = tsa .get_device_id ()
17
34
print (msg )
18
35
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/python3
2
+
3
+ ##-------------------------------------------------------------------------------\
4
+ # tinySA_python
5
+ # './examples/using_command_func.py'
6
+ # The command func can be used for commands or functionalities that exist on the
7
+ # tinySA series of devices but arent included in the library yet. There is NO
8
+ # built in error checking for this process.
9
+ #
10
+ # Last update: June 18, 2025
11
+ ##-------------------------------------------------------------------------------\
12
+
13
+
1
14
# import tinySA library
2
15
# (NOTE: check library path relative to script path)
3
16
from src .tinySA_python import tinySA
4
17
5
18
6
19
# create a new tinySA object
7
20
tsa = tinySA ()
21
+
22
+ # set the return message preferences
23
+ tsa .set_verbose (True ) #detailed messages
24
+ tsa .set_error_byte_return (True ) #get explicit b'ERROR' if error thrown
25
+
26
+
8
27
# attempt to autoconnect
9
28
found_bool , connected_bool = tsa .autoconnect ()
10
29
11
30
# if port closed, then return error message
12
31
if connected_bool == False :
13
32
print ("ERROR: could not connect to port" )
14
33
else : # if port found and connected, then complete task(s) and disconnect
15
- # detailed messages turned on
16
- tsa . set_verbose ( True )
34
+
35
+
17
36
# set scan values
18
37
start = 150e6 # 150 MHz
19
38
stop = 200e6 # 200 MHz
20
39
pts = 450 # for tinySA Ultra
21
40
outmask = 1 # get measured data (y axis)
41
+
22
42
# scan
23
43
data_bytes = tsa .command ("scan 150e6 200e6 5 2" )
24
44
You can’t perform that action at this time.
0 commit comments