From 91bb1dc9a919d30b7237a483eab337cbd0d7378d Mon Sep 17 00:00:00 2001 From: Quan Lin <36973354+jacklinquan@users.noreply.github.com> Date: Mon, 26 Nov 2018 16:44:11 +1100 Subject: [PATCH] Update example.py --- example/example.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/example/example.py b/example/example.py index 57da187..0519846 100644 --- a/example/example.py +++ b/example/example.py @@ -1,14 +1,20 @@ -# When this script is run for the first time, it might prompty you for permission. -# Accept the permission and run this script again, then it should send the data as expected. +# When this script is run for the first time, it might prompty you for +# permission. Accept the permission and run this script again, then it should +# send the data as expected. # Kivy is needed for pyjnius behind the scene. import kivy from usb4a import usb -from usbserial4a.serial4a import get_serial_port +from usbserial4a import serial4a usb_device_list = usb.get_usb_device_list() if usb_device_list: - serial_port = get_serial_port(usb_device_list[0].getDeviceName(), 9600, 8, 'N', 1) + serial_port = serial4a.get_serial_port( + usb_device_list[0].getDeviceName(), + 9600, + 8, + 'N', + 1) if serial_port and serial_port.is_open: serial_port.write(b'Hello world!') serial_port.close()