1 of 8

Adam Thomas

Professor, Media Studies and IT�Faculty of Media and Creative Arts�MA Learning and Technology�adam.thomas@humber.ca�codeadam.ca

2 of 8

Weasley's Hat

3 of 8

Diagon Alley

Weasley’s Wizard Wheezes�Set #75978

The LEGO Group. (n.d.). Diagon Alley™. Retrieved 2022, from https://www.lego.com/en-ca/product/diagon-alley-75978.

4 of 8

Module Description

Weasley’s hat from the Diagon Alley set already has a lever to tip his hat manually. This module will tip his hat automatically every ten seconds.

The LEGO Group. (n.d.). Diagon Alley™. Retrieved 2022, from https://www.lego.com/en-ca/product/diagon-alley-75978.

5 of 8

Sensors and Motors

The only output port will be attached to an EV3 servo motor.

6 of 8

Ports

Weasley’s hat will require one output port on an EV3 hub to connect a motor.

7 of 8

Variables/Settings

Status: Can be set to "on" or "off". When on Weasley’s hap will tip every ten minutes.

Interval can be changed.

8 of 8

IOT Loop

While True� � If status == "on"�� If counter == 0� Start motor slow clockwise�� Else If counter == 10� Stop motor�� Else If counter == 50� Start motor slow counter-clockwise�� Else If counter == 60� Stop motor

The LEGO Group. (n.d.). Diagon Alley™. Retrieved 2022, from https://www.lego.com/en-ca/product/diagon-alley-75978.