Skip to main content

Posts

Showing posts with the label board

Disco micro:pixel

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) while True:     pxl=random.randint(1,30)     rd=random.randint(1,32)     gr=random.randint(1,32)     bl=random.randint(1,32)     t1=random.randint(10,100)   ...

micro:pixel board, micro:bit and micropython

A new (or to me at least)  addition to devices you can attach a Micro:Bit to, is the Proto-Pic micro:pixel 4x8 NeoPixel board; essentially a board with 4 x8 grid of NeoPixels that you plug the Micro:Bit into. Following the advice of the website the  values of RGB are all set to 32 or below to avoid pulling too much power. Pin0 is used to write to. You will need to use the Mu editor for this. Two tests were tried Example 1: To get the pixels to appear to light up from the last to the first one. from microbit import * import neopixel np = neopixel.NeoPixel(pin0, 32) while True:     for x in range(0, 32):         for y in range(0, (32-x)):             np[y] = (y, 32-y, 1)             if (y>0):                 np[y-1]=(0,0,0)             np.show()             sl...