Capstone Project
Capstone Project
import tkinter
from tkinter import ttk
speed_entry_box.grid()
arm_calibrate_button.grid()
arm_calibrate_button['command'] = lambda: arm_calibration(speed_entry_box, mqtt_sender)
location_label.grid()
arm_location_entry_box.grid()
arm_to_button.grid()
arm_to_button['command'] = lambda: arm_to(speed_entry_box, arm_location_entry_box, mqtt_sender)
arm_up_button.grid()
arm_up_button['command'] = lambda: handle_arm_up(speed_entry_box, mqtt_sender)
arm_down_button.grid()
arm_down_button['command'] = lambda: handle_arm_down(speed_entry_box, mqtt_sender)
color_label.grid()
stop_color_entry_box.grid()
forward_until_color_button.grid()
forward_until_color_button['command'] = lambda: \
forward_until_color(speed_entry_box, stop_color_entry_box, mqtt_sender)
# Return your frame:
return frame
class MyLaptopDelegate(object):
"""
Defines methods that are called by the MQTT listener when that listener
gets a message (name of the method, plus its arguments)
from the ROBOT via MQTT.
"""
def __init__(self, root):
self.root = root # type: tkinter.Tk
self.mqtt_sender = None # type: mqtt.MqttClient