Skip to content

Instantly share code, notes, and snippets.

@uruskan
Created September 2, 2019 13:09
Show Gist options
  • Save uruskan/1b77ac210ccaf4e37e9d2376303d5296 to your computer and use it in GitHub Desktop.
Save uruskan/1b77ac210ccaf4e37e9d2376303d5296 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import serial as sl
import time
ser = sl.Serial('COM10', baudrate=9600)
rawdata=[]
count = 0
a = str(ser.readline())
while count < 70:
rawdata.append(str(ser.readline()))
time.sleep(0.10)
count = count + 1
# if ("tamam" in str(ser.readline())): Arduion'dan dogru veriler sayesinde 'tamam' geldigi zaman icin.
# print "MERHABA"
txt = str(ser.readline()).split('-') #Gelen verileri '-' gore ayirip yaziyor.
print (str(ser.readline()))
print "ilk : " , txt[0]
print "son : " , txt[1]
#print rawdata
#/dev/tty.usbmodem1421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment