def function_Direction(self):
		if(stepper_output.motor_direction):
			self.btnDirection.setText("Reverse")
			stepper_output.motor_direction = 0
		else:
			self.btnDirection.setText("Forward")
			stepper_output.motor_direction = 1
		#print(stepper_output.motor_direction)
		buzzer.beep_click(self.buzzerpin)
Example #2
0
 def function_Direction(self):
     if (stepper_output.motor_direction):
         self.btnDirection.setText("Reverse")
         stepper_output.motor_direction = 0
     else:
         self.btnDirection.setText("Forward")
         stepper_output.motor_direction = 1
     #print(stepper_output.motor_direction)
     buzzer.beep_click(self.buzzerpin)
	def function_motorStart(self):
		if(self.motorStart == 0):
			self.motorStart = 1
			#print("on")
			self.btnmotorStart.setStyleSheet("background-color: rgb(255,0,0);") #b,g,r format
			self.btnmotorStart.setText("Motor Stop")
			stepper_output.motor_enabled = 1
		elif(self.motorStart == 1):
			self.motorStart = 0
			#print("off")
			self.btnmotorStart.setStyleSheet("background-color: rgb(0,255,0);")
			self.btnmotorStart.setText("Motor Start")
			stepper_output.motor_enabled = 0
		buzzer.beep_click(self.buzzerpin)
Example #4
0
 def function_motorStart(self):
     if (self.motorStart == 0):
         self.motorStart = 1
         #print("on")
         self.btnmotorStart.setStyleSheet(
             "background-color: rgb(255,0,0);")  #b,g,r format
         self.btnmotorStart.setText("Motor Stop")
         stepper_output.motor_enabled = 1
     elif (self.motorStart == 1):
         self.motorStart = 0
         #print("off")
         self.btnmotorStart.setStyleSheet("background-color: rgb(0,255,0);")
         self.btnmotorStart.setText("Motor Start")
         stepper_output.motor_enabled = 0
     buzzer.beep_click(self.buzzerpin)
	def function_Exit(self):
		print("Exiting...type2\n\n\n")
		buzzer.beep_click(self.buzzerpin)
		self.function_Estop()
		grovepi.analogWrite(self.peltierfanpin1,0) #aircon, 0-255
		grovepi.analogWrite(self.peltierfanpin2,0) #coldblock, 0-255
		grovepi.ledCircle_off(self.ledcirclepin)
		herkulex.alive = 0
		camera_linedetection.alive = 0
		stepper_output.alive = 0
		coldblock_output.alive = 0
		hotend_output.alive = 0
		aircon_output.alive = 0
		sensors.alive = 0
		time.sleep(1.0)
		sensors.ambience_sensor_enabled = 0 
		sensors.adc1_sensor_enabled = 0 
		sensors.adc2_sensor_enabled = 0 
		sensors.adc3_sensor_enabled = 0 
		time.sleep(1.0)
		sys.exit()
Example #6
0
 def function_Exit(self):
     print("Exiting...type2\n\n\n")
     buzzer.beep_click(self.buzzerpin)
     self.function_Estop()
     grovepi.analogWrite(self.peltierfanpin1, 0)  #aircon, 0-255
     grovepi.analogWrite(self.peltierfanpin2, 0)  #coldblock, 0-255
     grovepi.ledCircle_off(self.ledcirclepin)
     herkulex.alive = 0
     camera_linedetection.alive = 0
     stepper_output.alive = 0
     coldblock_output.alive = 0
     hotend_output.alive = 0
     aircon_output.alive = 0
     sensors.alive = 0
     time.sleep(1.0)
     sensors.ambience_sensor_enabled = 0
     sensors.adc1_sensor_enabled = 0
     sensors.adc2_sensor_enabled = 0
     sensors.adc3_sensor_enabled = 0
     time.sleep(1.0)
     sys.exit()
	def function_cameraStart(self):
		if(self.cameraStart == 0):
			self.cameraStart = 1
			#print("on")
			self.btnCamera.setStyleSheet("background-color: rgb(255,0,0);") #b,g,r format
			self.btnCamera.setText("Camera Off")
			camera_linedetection.camera_enabled = 1
			#turn lights on
			grovepi.ledCircle_init(self.ledcirclepin)
			time.sleep(0.2)
			grovepi.ledCircle_on(self.ledcirclepin) #intensity is 0-255
			time.sleep(0.15)
		elif(self.cameraStart == 1):
			self.cameraStart = 0
			#print("off")
			self.btnCamera.setStyleSheet("background-color: rgb(0,255,0);")
			self.btnCamera.setText("Camera On")
			camera_linedetection.camera_enabled = 0
			#turn listopghts off
			#grovepi.ledCircleintensity(self.ledcirclepin, buf)
			grovepi.ledCircle_off(self.ledcirclepin) #intensity is 0-255
			time.sleep(0.15)
		buzzer.beep_click(self.buzzerpin)
Example #8
0
 def function_cameraStart(self):
     if (self.cameraStart == 0):
         self.cameraStart = 1
         #print("on")
         self.btnCamera.setStyleSheet(
             "background-color: rgb(255,0,0);")  #b,g,r format
         self.btnCamera.setText("Camera Off")
         camera_linedetection.camera_enabled = 1
         #turn lights on
         grovepi.ledCircle_init(self.ledcirclepin)
         time.sleep(0.2)
         grovepi.ledCircle_on(self.ledcirclepin)  #intensity is 0-255
         time.sleep(0.15)
     elif (self.cameraStart == 1):
         self.cameraStart = 0
         #print("off")
         self.btnCamera.setStyleSheet("background-color: rgb(0,255,0);")
         self.btnCamera.setText("Camera On")
         camera_linedetection.camera_enabled = 0
         #turn listopghts off
         #grovepi.ledCircleintensity(self.ledcirclepin, buf)
         grovepi.ledCircle_off(self.ledcirclepin)  #intensity is 0-255
         time.sleep(0.15)
     buzzer.beep_click(self.buzzerpin)
	def function_OFFhotend(self):
		self.lcdHotend.setStyleSheet("background-color: rgb(255,255,255);") #b,g,r format
		hotend_output.hotend_enabled = 0
		buzzer.beep_click(self.buzzerpin) 	
	def function_OFFcoldblock(self):
		self.lcdcoldblock.setStyleSheet("background-color: rgb(255,255,255);") #b,g,r format
		coldblock_output.coldblock_enabled = 0 
		buzzer.beep_click(self.buzzerpin)	
	def function_OFFaircon(self):
		self.lcdAircon.setStyleSheet("background-color: rgb(255,255,255);") #b,g,r format
		aircon_output.aircon_enabled = 0 
		buzzer.beep_click(self.buzzerpin)	
Example #12
0
 def function_OFFhotend(self):
     self.lcdHotend.setStyleSheet(
         "background-color: rgb(255,255,255);")  #b,g,r format
     hotend_output.hotend_enabled = 0
     buzzer.beep_click(self.buzzerpin)
Example #13
0
 def function_OFFcoldblock(self):
     self.lcdcoldblock.setStyleSheet(
         "background-color: rgb(255,255,255);")  #b,g,r format
     coldblock_output.coldblock_enabled = 0
     buzzer.beep_click(self.buzzerpin)
Example #14
0
 def function_OFFaircon(self):
     self.lcdAircon.setStyleSheet(
         "background-color: rgb(255,255,255);")  #b,g,r format
     aircon_output.aircon_enabled = 0
     buzzer.beep_click(self.buzzerpin)