def black_line_set_OnButtonClick(self,event): for i in range(2): line_sensor.get_sensorval() line_sensor.set_black_line() line_val=line_sensor.get_black_line() self.label.SetLabel("Black Line : "+str(line_val))
def black_line_set_OnButtonClick(self, event): for i in range(2): line_sensor.get_sensorval() line_sensor.set_black_line() line_val = line_sensor.get_black_line() self.label.SetLabel("Black Line : " + str(line_val))
try: line=l.line_position() except: if en_debug: e = sys.exc_info()[1] print "Error reading Line sensor: " + str(e) if en_debug: print "Line Sensor Readings: " + str(line) if en_gpg: s.sensorupdate({'line':line}) elif msg.lower()=="SET_BLACK_LINE".lower(): if en_line_sensor: print "SET_BLACK_LINE!" try: l.set_black_line() except: if en_debug: e = sys.exc_info()[1] print "Error reading Line sensor: " + str(l.black_line) if en_debug: print "Black Line Sensor Readings: " + str(l.black_line) if en_gpg: s.sensorupdate({'black_line':l.black_line}) elif msg.lower()=="SET_WHITE_LINE".lower(): if en_line_sensor: print "SET_WHITE_LINE!" try: l.set_white_line() except:
try: line=l.line_position() except: if en_debug: e = sys.exc_info()[1] print "Error reading Line sensor: " + str(e) if en_debug: print "Line Sensor Readings: " + str(line) if en_gpg: s.sensorupdate({'line':line}) elif msg=="SET_BLACK_LINE": if en_line_sensor: print "SET_BLACK_LINE!" try: l.set_black_line() except: if en_debug: e = sys.exc_info()[1] print "Error reading Line sensor: " + str(l.black_line) if en_debug: print "Black Line Sensor Readings: " + str(l.black_line) if en_gpg: s.sensorupdate({'black_line':l.black_line}) elif msg=="SET_WHITE_LINE": if en_line_sensor: print "SET_WHITE_LINE!" try: l.set_white_line() except:
print "WHITE LINE SETUP!!" while True: print "Keep all the sensors over a white strip and press [Enter]" raw_input() print "--> Line sensor value: ", get_sensorval() print get_sensorval() print "If the reading look good, press 'y' and [Enter] to continue" inp = raw_input() if inp == 'y': line_sensor.set_white_line() break print "White Line Values set: ", print line_sensor.get_white_line() print "BLACK LINE SETUP!!" while True: print "Keep all the sensors over a black strip and press [Enter]", raw_input() print "--> Line sensor value: ", get_sensorval() print get_sensorval() print "If the reading look good, press 'y' and [Enter] to continue" inp = raw_input() if inp == 'y': line_sensor.set_black_line() break print "White Line Values set: ", print line_sensor.get_black_line()
print "WHITE LINE SETUP" while True: print "\nKeep all the sensors over a white strip and press ENTER", raw_input() print "--> Line sensor readings: ", get_sensorval() print get_sensorval() print "If the reading look good, press 'y' and Enter to continue, any other key to read again" inp=raw_input() if inp=='y': line_sensor.set_white_line() break print "White Line values set:", print line_sensor.get_white_line() print "BLACK LINE SETUP" while True: print "\nKeep all the sensors over a black strip and press ENTER", raw_input() print "--> Line sensor readings: ", get_sensorval() print get_sensorval() print "If the reading look good, press 'y' and Enter to continue, any other key to read again" inp=raw_input() if inp=='y': line_sensor.set_black_line() break print "Black Line values set:", print line_sensor.get_black_line()