Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.
Monday, 31 October 2016
Simple (and temporary) Halloween Hack
This really is a simple one. A Glowbug (or a NeoPixel) with the data in, Ground and 5v connected pushed into the neck of the balloon, then inflated the balloon. The neck of the balloon and wires are twisted tightly and insulating tape used to provide a bit of a seal.
The data in wire is connected to Pin 0 of a Micro:Bit and the other two wires are attached to the corresponding connections of the Micro:Bit. The code below randomly selects the colours and the length of the delay before changing colour.
from microbit import *
import neopixel, random
np = neopixel.NeoPixel(pin0, 1)
while True:
rd=random.randint(1,254)
gr=random.randint(1,254)
bl=random.randint(1,254)
t1=random.randint(200,2000)
np[0] = (rd, gr, bl)
np.show()
sleep(t1)
The problem is a slow leak means it only stays inflated for a short while.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Subscribe to:
Post Comments (Atom)
DIY Data Science with microbits
DIY Data Science: A Complete Guide to Data Logging with the Micro:bit V1 Whether you are a STEM teacher looking for a classroom lab solution...
-
In the previous blog posts for this 'series' "It is a good time...." Post 1 looked at the hardware unpinning some of...
-
The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids , tha...
-
You don't need to buy a robot to get programming a robot, now there are a range of free and relatively simple to start with robot simula...
This comment has been removed by a blog administrator.
ReplyDelete