Example #1
0
    def BlueLed1Set():

        input = blueLed1Input.get()

        while len(input) < 5:
            input = "0" + input

        print("14_" + input + "\r\n")

        UART.serialWrite("14_" + input + "\r\n")

        return blueLed1Input.get()
Example #2
0
	def BlueLed1Set(self):
		
		input = self.blueLed1Input.get()
		
		self.BlueLED1State = input
			
		while (len(input) < 5):
			input = "0" + input
				
		print("14_" + input + "\r\n")
		
		UART.serialWrite("14_" + input + "\r\n")
Example #3
0
def main():
	
	# Pause to let program initialise
	time.sleep(1)
	
	# Create object of GUIclass from GUI header and create a thread that runs the createGUI function from that class
	
	ArbiGUI = GUI.GUIclass()
	guiThread = threading.Thread(target = ArbiGUI.createGUI)
	guiThread.start()
	
	# Create object of data logging class from DataLogger header. Erases data from file name if it exists from last user
	ArbiDataLogger = DataLogger.DataLoggerClass("maintextfile.txt")
	ArbiDataLogger.clearFile()
	
	# Create object of control AI class from AI header
	ArbiAI = AI.AiClass()

	
	# Main loop
	while True:
		time.sleep(0.5)
		ArbiAI.status()
		
		ArbiAI.decide()
		
		state = ArbiGUI.getBlueLED1State()

		print state

		line = UART.serialWrite("3 serial msg from main\r\n",)		
		
		ArbiDataLogger.logData(line)