Create raspi_serial.py

This commit is contained in:
bernd2k 2018-03-18 01:34:09 +01:00 committed by GitHub
parent 3acffedafc
commit 186d28ccf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,16 @@
#!/usr/bin/python3
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
# read Arduino
while True:
input = ser.readline()
input_number = input
print ("Time: " + str(int(time.time())) + " Reflection Value: " + str(input_number)[:-2] + "[v]")