From b523aa8112e729634ca6497360dc91a267075c02 Mon Sep 17 00:00:00 2001 From: Mike Barela Date: Wed, 8 Aug 2018 17:31:43 -0400 Subject: [PATCH] Update serial-read-write.py del whitespace --- CPX_Serial/serial-read-write.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CPX_Serial/serial-read-write.py b/CPX_Serial/serial-read-write.py index e0baf423..37ea0775 100644 --- a/CPX_Serial/serial-read-write.py +++ b/CPX_Serial/serial-read-write.py @@ -2,17 +2,17 @@ import time import board import busio from adafruit_circuitplayground.express import cpx - + uart = busio.UART(board.TX, board.RX, baudrate=115200) - + while True: - + data = uart.read(1) # read a byte - + if data is not None: # Data was received - - output = "%0.1f\t%d\t%0.1f\r\n" % (time.monotonic(), - cpx.light, cpx.temperature) - uart.write(output) # Print to serial - + + output = "%0.1f\t%d\t%0.1f\r\n" % (time.monotonic(), + cpx.light, cpx.temperature) + uart.write(output) # Print to serial + time.sleep(1.0)