Skip to content

Instantly share code, notes, and snippets.

@ereli
Created September 11, 2014 11:45
Show Gist options
  • Save ereli/ee904670c5c851727b49 to your computer and use it in GitHub Desktop.
Save ereli/ee904670c5c851727b49 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import serial
from datetime import datetime
import winsound
#import msvcrt
ser = serial.Serial("COM4", 9600)
while True:
s = str(ser.readline())
#c = msvcrt.getch()
#n = int(s.split(" / ")[0])
#print int(s)
if int(s) !=-1:
winsound.Beep(163*int(s),250)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment