In previous post I played with using the combination of the Proto-Pic Micro:pixel and Micro:Bit to react, using the accelerometer, to music through a computer speakers. The vibrations from the music shake the Micro:Bit enough to give measurable changes in three axis, and these values are used to change the pixels colour.
The latest version of this uses most of pixels.
Coded in micropython using the Mu editor.
from microbit import *
import neopixel, random
np = neopixel.NeoPixel(pin0, 32)
while True:
for pxl in range (2,32, 5):
rd=int(abs(accelerometer.get_x())/20)
gr=int(abs(accelerometer.get_y())/20)
bl=int(abs(accelerometer.get_z())/20)
np[pxl] = (rd, gr, 0)
np[pxl-1] = (rd, gr, 0)
np[pxl+1] = (0, gr, rd)
np[pxl-2] = (rd, 0, 0)
np[pxl+2] = (0, gr,0)
np.show()
Video of it action, using royalty-free music Electro Deluxe by My Free Mickey feat. Gurdonark. http://dig.ccmixter.org/files/myfreemickey/48180
As one of the reviewers on Proto-Pic site states, the box the Micro:pixel comes in does make a good diffuser.
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
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.
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...
Linking the NeoPixel colors to the Accelerometer x,y,z coordinates is a pretty cool idea. I'll have to play more with that idea. Thanks.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete