

WeDo 2.0 supports a hands-on, “minds on” learning solution that gives students the confidence to ask questions and the tools to find the answers and to solve real-life problems. This is done through the use of motorized LEGO® models and simple programming. LEGO® Education WeDo 2.0 is developed to engage and motivate elementary students’ interest in learning science- and engineering-related subjects.

LEGO WeDo 2.0 Modelįirst, let me introduce WeDo 2.0 briefly in case you did not notice. Don’t worry, I met the similar problems and here let me show you some typical issues and how to solve them. When press the connect button, use DiscoveryService to get all available devices and use GATTRequester to connect the device.For those people first using LEGO Education WeDo 2.0, you might meet connection issues when you try to connect the SmartHub to LEGO Programming App, or to connect Scratch 3.0.


Button ( root, text = 'Stop motor', width = BUTTON_WIDTH, command = stop, state = 'disabled' ) button_stop. Button ( root, text = 'Speed down', width = BUTTON_WIDTH, command = down, state = 'disabled' ) button_down. Button ( root, text = 'Speed up', width = BUTTON_WIDTH, command = up, state = 'disabled' ) button_up. Button ( root, text = 'Run motor', width = BUTTON_WIDTH, command = run, state = 'disabled' ) button_run. Button ( root, text = 'Disconnect Smart Hub', width = BUTTON_WIDTH, command = disconnect, state = 'disabled' ) button_disconnect. Button ( root, text = 'Connect Smart Hub', width = BUTTON_WIDTH, command = connect ) button_connect. Label ( root, fg = "dark green", text = 'N/A' ) label. title ( "Lego Wedo 2.0 Motor Control" ) label = tk. after ( DELAY, motor_up ) def down (): global button_down button_down. after ( DELAY, smart_hub_disconnect ) def up (): global button_up button_up. after ( DELAY, smart_hub_connect ) def disconnect (): global button_disconnect button_disconnect. after ( DELAY, motor_stop ) def connect (): global button_disconnect button_disconnect. after ( DELAY, motor_run ) def stop (): global button_stop button_stop. Import Tkinter as tk from gattlib import DiscoveryService from gattlib import GATTRequester from time import sleep def run (): global button_run button_run.
