Skip to content

Latest commit

 

History

History
88 lines (50 loc) · 2.29 KB

grimmauld-place.markdown

File metadata and controls

88 lines (50 loc) · 2.29 KB

12 Grimmauld Place

12 Grimmauld Place

LEGO (n.d.). LEGO 12 Grimmauld Place. Retrieved August 7, 2023, from https://www.lego.com/en-ca/product/12-grimmauld-place-7640

Description

The official 12 Girmmauld Place LEGO® set has a built in interactive feature. When the back of the building is pushed towards the front, the two front buildings slide open to reveal a third.

12 Grimmauld Place

LEGO (n.d.). LEGO 12 Grimmauld Place. Retrieved August 7, 2023, from https://www.lego.com/en-ca/product/12-grimmauld-place-7640

This motion will be connected to a motor so the interaction can be automated.

This interaction will have an interesting effect on the GPS and mapping tools. Unlike most buildings, this building only exists at certain times. OR the building could be in hiding until the mapping system receives a request for this address.

Requirements

This interaction will only require a large EV3 motor and the EV3 hub:

Pseudocode

In this example, the location is only available when recently requested:

REPEAT-EVERY 30 Seconds

    IF LastGpsRequest < 30 Minutes THEN

        LocationStatus = TRUE
        RotateMotor to 0

    ELSE

        LocationStatus = FALSE
        RotateMotor to 360

    ENDIF

ENDREPEAT

In this example, the building is only available between 11:00 am and 1:00 pm. A GPS request will return false when the building is not available:

REPEAT-EVERY 1 Hour

    IF Hour > 11:00 AM AND Hour < 1:00 PM THEN

        LocationStatus = TRUE
        RotateMotor to 0

    ELSE

        LocationStatus = FALSE
        RotateMotor to 360

    ENDIF

ENDREPEAT

ON RequestGpsLocation EVENT

    IF LocationStatus == TRUE THEN

        RETURN GpsLocation

    ELSE

        RETURN FALSE

    ENDIF

ENDEVENT

➔ Back to Hackathon