Skip to content

Commit

Permalink
pad to boards in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Neradoc committed Mar 18, 2022
1 parent cca02a0 commit 9b6e9c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/find_boards_with_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

# use filters based on given parameters
if vid != 0 and product_name == "":
pad = discotool.devices_by_vidpid(vid)
boards = discotool.devices_by_vidpid(vid)
elif not product_name:
pad = discotool.devices_by_name(PRODUCT_NAME)
boards = discotool.devices_by_name(PRODUCT_NAME)
else:
pad = discotool.devices_by_name(product_name)
boards = discotool.devices_by_name(product_name)

# send data to whatever is found
if pad and (data_port := pad[0].data):
print(f"Board found: {pad[0].name}")
if boards and (data_port := boards[0].data):
print(f"Board found: {boards[0].name}")
print(f"Send {data_string} to {data_port}")
with serial.Serial(data_port) as pp:
pp.write(data_string)
Expand Down

0 comments on commit 9b6e9c2

Please sign in to comment.