Saturday, 22 October 2016
In a previous post Proto-Pic board, Microbit and Micropython I played with the Proto-Pic micro:pixel 4x8 NeoPixel board.
This post is just a short description of a quick play with making it flashing blocks of different colours across the board. The routine produces five random numbers (three to define the colours, one for which pixel is selected and the last for the delay each iteration). The idea of being - a pixel is selected, but so are the ones either side of it, each one has a different combination of the colour values, but only two of the pixels are turned off after the delay.
from microbit import *
import neopixel, random
# Setup the Neopixel strip on pin0 with a length of 2 pixels
np = neopixel.NeoPixel(pin0, 32)
np[pxl] = (rd, gr, bl)
np[pxl-1] = (gr, bl, rd)
np[pxl+1] = (bl, rd, gr)
np[pxl] = (0, 0, 0)
np[pxl+1] = (0, 0, 0)
The video below shows the routine in action. There is no connection between the pixels and the music on the video - but making the connection between music and the pixels would be an interesting project.
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
In the previous two post I built and played with a robot unicorn from Do it Kits https://doitkits.com/product/robot-unicorn/ . In the first...
You can control servos (small ones) from a Micro:Bit directly. Following a link from the David Whale (Twitter @ whaleygeek ) , thank you, t...
On the 1st September 2017, during 'Force Friday', LittleBits launched their new kit Star Wars Droid Inventor Kit an R2D2 shaped rob...
I wanted to contol the CBiS micro:Bit Car via gestures whilst holding another micro:Bit (see Figure 1) I went for: - Button A in combinat...