def button(): if DAQC2.getDINbit(0,0) == 0: global button_pressed button_pressed = 1 #print button_pressed print "Button Pressed" DAQC2.setDOUTbit(0,0) sleep(0.02) DAQC2.clrDOUTbit(0,0) sleep(0.2) return()
def button(): if DAQC2.getDINbit(0,0) == 0: global button_pressed button_pressed = 1 print ("Button Pressed") global insert_num insert_num = input("Enter insert #: ") DAQC2.setDOUTbit(0,0) sleep(0.02) DAQC2.clrDOUTbit(0,0) sleep(0.015) return
def probeUpdater(self): if self.record and self.enabled: #piplate holds all pins high #pinReading = (0 if DAQC2.getDINbit(0,self.pin) else 1) pinReading = DAQC2.getDINbit(0,self.pin) self.pdata.append(pinReading) self.pcurve.setData(self.pdata) #Testing threading (requires data to be added to func parameters) '''if self.record and self.enabled:
def button(): if DAQC2.getDINbit(0,0) == 0: global button_pressed button_pressed = 1 DAQC2.setDOUTbit(0,0) sleep(0.02) DAQC2.clrDOUTbit(0,0) sleep(0.015) relay() time.sleep(0.01) get_audio() button_pressed = 0 return
resp['state'] = this_state elif (cmd == "RESET"): RP.RESET(addr) resp['RESET'] = "OK" else: sys.stderr.write("unknown relay cmd: " + cmd) break print(json.dumps(resp)) elif (plate_type == "DAQC"): with simpleflock.SimpleFlock("/tmp/daqc.lock", timeout=3): if (cmd == "getDINbit"): bit = args['bit'] try: state = DP.getDINbit(addr, bit) except AssertionError: state = DP2.getDINbit(addr, bit) resp['bit'] = bit resp['state'] = state elif (cmd == "setDOUTbit"): bit = args['bit'] try: DP.setDOUTbit(addr, bit) except AssertionError: DP2.setDOUTbit(addr, bit) resp['bit'] = bit resp['state'] = 1 elif (cmd == "clrDOUTbit"): bit = args['bit'] try: DP.clrDOUTbit(addr, bit) except AssertionError:
def run(self): while True: data = DAQC2.getDINbit(0, self.pin) self.newData.emit(data) time.sleep(0.05)
def get_value(self): return bool(DQ.getDINbit(self.piid, self.tid))