You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
389 B
15 lines
389 B
import serial # stáhnout pyserial 3.5
|
|
import time
|
|
|
|
ser = serial.Serial("COM3",9600) # COM# z arduino IDE kde máte zapojený arduino
|
|
|
|
while True:
|
|
line = ser.readline().decode("utf-8").strip()
|
|
|
|
sensor_name, sensor_value = line.split(":")
|
|
|
|
print(f"Nazev senzoru: {sensor_name}")
|
|
print(f"Hodnota senzoru: {sensor_value}")
|
|
print("---------------------")
|
|
|
|
time.sleep(1)
|