Skip to content

Instantly share code, notes, and snippets.

@nkenna
Created June 30, 2018 20:43
Show Gist options
  • Save nkenna/3524f294275fbe948d2605f688dd8f00 to your computer and use it in GitHub Desktop.
Save nkenna/3524f294275fbe948d2605f688dd8f00 to your computer and use it in GitHub Desktop.
generate random ints from 1 - 5
print(ser.readline())
num = random.randint(1, 5)
print(num)
ser.write(bytes(str(num), 'utf-8'))
print(str(num))
time.sleep(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment