You will need:
- A code bug colour star
- 3 x jumper cables see below, fig 1
- 3 x Crocodile clips see below, fig 2
fig 1
fig 2
Instructions1. Turn the colour star so you can see the pins on the back. Attach one jumper cable to the data in pin and then attach a crocodile cable see fig 2 to the jumper cable and attach to the Micro:bit pin 0.
2. Attach the second jumper cable to the GND pin on the colour star and then attach a crocodile cable see fig 2 to the jumper cable and attach to the Micro:bit GND pin.
2. Attach the third jumper cable to the 5V pin on the colour star and then attach a crocodile cable see fig 2 to the jumper cable and attach to the Micro:bit 3V pin.
3. Attach the Microbit to your PC/Pi Open MU micro python IDE.
4. Type in the following code:
from microbit import *
import neopixel
from random import randint
np = neopixel.NeoPixel(pin0,9)
while True:
for pixel_id in range(0,len(np)):
red = 255
green = 0
blue = 0
np[pixel_id] = (red,green,blue)
np.show()
sleep(200)
np.clear()
5. Flash the code to the Micro:bit.
http://microbit-micropython.readthedocs.io/en/latest/neopixel.html
I have changed it to loop a red light around the neopixels. (See fig 3)
Fig 3
This comment has been removed by a blog administrator.
ReplyDelete