Michael Klein
Published © CC BY-SA

Neopixelmatrix micro:pixel 4x8 am Calliope Mini

Anschluss und Programmiertipps (Range/Matrix) zur 4x8 Neopixelmatrix von PROTO-PIC am Calliope Mini.

BeginnerProtip682
Neopixelmatrix micro:pixel 4x8 am Calliope Mini

Things used in this project

Hardware components

Calliope mini
Calliope mini
×1
Alligator Clips
Alligator Clips
×1

Software apps and online services

MakeCode
Microsoft MakeCode

Story

Read more

Schematics

range.hex

passendes hexfile zu range

matrix.hex

Passendes hexfile zu matrix

Code

matrix

JavaScript
Teilt die LED-Matrix in vier Achterreihen ein und lässt ein paar Punkte darauf leuchten
let neo: kitronik.Strip = null
neo = kitronik.create(DigitalPin.P0, 32, ZipLedMode.RGB)
neo.setMatrixWidth(8)
neo.setBrightness(100)
basic.forever(() => {
    neo.setMatrixColor(0, 0, kitronik.colors(ZipLedColors.Blue))
    neo.setMatrixColor(1, 1, kitronik.colors(ZipLedColors.Green))
    neo.setMatrixColor(4, 2, kitronik.colors(ZipLedColors.Purple))
    neo.setMatrixColor(7, 3, kitronik.colors(ZipLedColors.Red))
    neo.show()
})

range

JavaScript
Gegenläufiges doppeltes Lauflicht mit dem Range Befehl
let reihe4: kitronik.Strip = null
let reihe3: kitronik.Strip = null
let reihe2: kitronik.Strip = null
let reihe1: kitronik.Strip = null
let neo: kitronik.Strip = null
let Index = 0
neo = kitronik.create(DigitalPin.P0, 32, ZipLedMode.RGB)
neo.setBrightness(32)
reihe1 = neo.range(0, 8)
reihe2 = neo.range(8, 8)
reihe3 = neo.range(16, 8)
reihe4 = neo.range(24, 8)
reihe1.setPixelColor(0, kitronik.colors(ZipLedColors.Red))
reihe2.setPixelColor(7, kitronik.colors(ZipLedColors.Yellow))
reihe3.setPixelColor(0, kitronik.colors(ZipLedColors.Green))
reihe4.setPixelColor(7, kitronik.colors(ZipLedColors.Blue))
neo.show()
basic.pause(100)
basic.forever(() => {
    for (let Index = 0; Index <= 6; Index++) {
        basic.pause(100)
        reihe1.shift(1)
        reihe2.shift(-1)
        reihe3.shift(1)
        reihe4.shift(-1)
        neo.show()
    }
    for (let Index = 0; Index <= 6; Index++) {
        basic.pause(100)
        reihe1.shift(-1)
        reihe2.shift(1)
        reihe3.shift(-1)
        reihe4.shift(1)
        neo.show()
    }
})

Credits

Michael Klein

Michael Klein

41 projects • 52 followers
Na klar Bio! Oder direkt aus dem Garten ;-)

Comments