mirror of
https://github.com/ft-NotArt/ShyEye.git
synced 2025-10-29 12:26:01 +00:00
15 lines
362 B
Python
15 lines
362 B
Python
# Importing Libraries
|
|
import serial
|
|
import time
|
|
arduino = serial.Serial(port='/dev/ttyACM0', baudrate=9600, timeout=.1)
|
|
def write_read(x):
|
|
arduino.write(bytes(x, 'utf-8'))
|
|
time.sleep(0.05)
|
|
data = arduino.readline()
|
|
return data
|
|
|
|
while True:
|
|
num = input("Enter a number: ") # Taking input from user
|
|
value = write_read(num)
|
|
print(value) # printing the value
|