You will glad to hear this is only a short post. In an earlier post, Build a Disco Cube:bit that reacts to music ; the vibrations of music, makes the cube sitting on a speaker with the volume pushed to 11 (just to test it of course) react to the music. The accelerometers values in the micro:bit, in the three axis, are feedback to change the neopixels colour. Simple but good fun. With some very minor (and I do mean minor) changes it works on the Kitronik's Game Zap - eight pixels are altered at a time instead of five but apart from that nothing more. The code in python is shown below: from microbit import * import neopixel, random np = neopixel.NeoPixel(pin0, 64) while True: for pxl in range (3,64, 8): 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) ...
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.