Skip to content

Commit

Permalink
some commented prints
Browse files Browse the repository at this point in the history
  • Loading branch information
cpmpercussion committed Aug 15, 2024
1 parent c8e68db commit 08e6894
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion impsy/impsio.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def __init__(self, config: dict, callback: Callable[[int, float], None], dense_c

def send(self, output_values) -> None:
"""Send values as a CSV line."""
output_message = ','.join(map(str, output_values)) + '\n'
output_message = ','.join(f"{num:.4f}" for num in output_values) + '\n'
# click.secho(f"Serial out: {output_message}")
if self.serial is not None:
self.serial.write(output_message.encode())

Expand All @@ -88,6 +89,7 @@ def handle(self) -> None:
try:
value_list = [float(x) for x in line.split(',')]
self.dense_callback(value_list) # callback with the value list.
# click.secho(f"Serial parsed: {value_list}", fg="green")
except ValueError:
click.secho(f"Serial: Could not parse line: {line}", fg="red")

Expand Down

0 comments on commit 08e6894

Please sign in to comment.