Rewatching the Miyazaki/Studio Ghibli movies, I was keen to recreate some of the items from Laputa: Castle in the Sky…
Dola / Dōra Pirate Logo
Looks great on a t-shirt…
Laputa Robot
I wanted to recreate the head of the garden robot, and wire it up to respond to messages on my network.
OnShape assets. Head = resin-printed + model paints; neck = laser-cut from 3mm-thick MDF.
Electronics
BoM: Raspberry Pi Pico W; red LED x 2; 330Ω resistor x 2.
Code
Extend my Raspberry Pi Pico W / Python / MQTT code by adding the following lines (near the top of that code):
import board import digitalio import random led1 = digitalio.DigitalInOut(board.GP16) led2 = digitalio.DigitalInOut(board.GP19) led1.direction = digitalio.Direction.OUTPUT led2.direction = digitalio.Direction.OUTPUT led1.value = False led2.value = False def do_eyes(): led1.value = False led2.value = False ss = 1/6 # seconds for ii in range(12): # for a total of 2-seconds if random.choice([True, False]): led1.value = not led1.value # end if if random.choice([True, False]): led2.value = not led2.value # end if time.sleep(ss) # end if led1.value = False led2.value = False # end do_eyes() def message(client, topic, message): do_eyes() # end message()
¤ Copyright 1999-2024 Chris Molloy ¤ All rights reserved ¤