Programming The BBC Micro:Bit For NeoPixels | Tutorial Accompanying Video

Поділитися
Вставка
  • Опубліковано 4 жов 2024

КОМЕНТАРІ • 7

  • @yes_man_lol
    @yes_man_lol Рік тому

    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.

  • @nickrattigan7704
    @nickrattigan7704 4 роки тому +1

    Nice project please do some more animations

  • @mikejb2009a
    @mikejb2009a 5 років тому

    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 .......

  • @mikejb2009a
    @mikejb2009a 5 років тому

    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)
    }
    }
    }
    }

  • @davidbooth3319
    @davidbooth3319 6 років тому

    Great Tutorial by please show us it working!

  • @davidbooth3319
    @davidbooth3319 6 років тому

    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?