Yes, if you have time please make more microbit tutorial, if can use MQTT with esp8266 + microbit, it will be good, there are some using low powered bluetooth with microbit and pi, but not common.
@nickrattigan77044 жыл бұрын
Nice project please do some more animations
@mikejb2009a5 жыл бұрын
Below is the code used in the above tutorial. It is in Java script you can see it in blocks if you want, just switch to blocks. Before cut and pasting it in load "neopixel extension" I made a change at "set pixel color at " and got good results. let z = 0 let y = 0 let x = 0 let strip = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB) let mode = true input.setAccelerometerRange(AcceleratorRange.EightG) strip.clear() strip.setBrightness(255) while (true) { if (input.buttonIsPressed(Button.A)) { mode = true basic.showLeds(` . . # . . . # # . . . . # . . . . # . . . # # # . `) } else { if (input.buttonIsPressed(Button.B)) { mode = false basic.showLeds(` . # # # . . . . # . . # # # . . # . . . . # # # . `) } if (mode == true) { strip.showRainbow(1, 360) } else { if (mode == false) { x = input.acceleration(Dimension.Y) - 55 y = input.acceleration(Dimension.X) * 2 z = input.acceleration(Dimension.Z) * 2 strip.setPixelColor(0, neopixel.rgb(x, y, z)) strip.shift(1) strip.show() basic.pause(50) } } } }
@mikejb2009a5 жыл бұрын
AT the "set micro pixel color at" line I thought it was a change sign bug but multiply "**" makes it work to. The source code for that block is probably on GitHub .......
@davidbooth33196 жыл бұрын
Great Tutorial by please show us it working!
@davidbooth33196 жыл бұрын
The download can not be edited in the new makecode Block editor which is a pity. This may be an issue with the new editor or with the code?