Created
February 3, 2013 01:19
-
-
Save MercuryRising/4700070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/python | |
import serial | |
import time | |
import sys | |
extruderSetPoint = 345 | |
bedSetPoint = 6300 | |
ser = serial.Serial("/dev/ttyUSB0", 115200) | |
ser.write("1") | |
# should hear relay click now, but I don't | |
while True: | |
line = ser.readline() | |
data = line.split(" ") | |
if len(data) > 7: | |
extruderResistance = float(data[3]) | |
bedResistance = float(data[-1].strip()) | |
if extruderResistance < extruderSetPoint and bedResistance < bedSetPoint: | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment