import serial
import time

def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break;
        time.sleep(0.5)
    return ser.read(len)

device = "com4"
buadrate = 9600
ser = serial.Serial(device, buadrate, timeout=1)
time.sleep(2) #wait for the Arduino to init

ser.write("1".encode()) 
#print ("read: %s" % read_serial(ser, 32))
ser.close()
ce10d7fcd3604f6d5006fe52a5724bf4d8fdd702
<mask token>


def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break
        time.sleep(0.5)
    return ser.read(len)


<mask token>

<mask token>


def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break
        time.sleep(0.5)
    return ser.read(len)


<mask token>
time.sleep(2)
ser.write('1'.encode())
ser.close()

<mask token>


def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break
        time.sleep(0.5)
    return ser.read(len)


device = 'com4'
buadrate = 9600
ser = serial.Serial(device, buadrate, timeout=1)
time.sleep(2)
ser.write('1'.encode())
ser.close()

import serial
import time


def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break
        time.sleep(0.5)
    return ser.read(len)


device = 'com4'
buadrate = 9600
ser = serial.Serial(device, buadrate, timeout=1)
time.sleep(2)
ser.write('1'.encode())
ser.close()

import serial
import time

def read_serial(ser, len):
    while True:
        if ser.inWaiting() > 0:
            break;
        time.sleep(0.5)
    return ser.read(len)

device = "com4"
buadrate = 9600
ser = serial.Serial(device, buadrate, timeout=1)
time.sleep(2) #wait for the Arduino to init

ser.write("1".encode()) 
#print ("read: %s" % read_serial(ser, 32))
ser.close()