Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import os, sys
- import serial
- import time
- import subprocess
- import syslog
- os.system('clear')
- in0 = input('What is your name?: ')
- os.system('clear')
- while 1:
- C = input('Hello, ' + in0 + ', Please enter a command: ')
- if C == 'R11':
- os.system('clear')
- port = '/dev/ttyACM0'
- ser = serial.Serial(port,115200,timeout=5)
- ser.write(b"R11")
- print(C + ', executed!')
- time.sleep(3)
- os.system('clear')
- elif C == 'R10':
- os.system('clear')
- port = '/dev/ttyACM0'
- ser = serial.Serial(port,115200,timeout=5)
- ser.write(b"R10")
- print(C + ', executed!')
- time.sleep(3)
- os.system('clear')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement