Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Commit e57fc98

Browse files
committed
show on block
1 parent a24dd7a commit e57fc98

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

EPXDisplay.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ namespace EPXDisplay {
1919
//% weight=88
2020
export function play(strip: neopixel.Strip, anim: EPXAnimations) {
2121
switch(anim) {
22-
case EPXAnimations.Globe: playBuffer(strip, spinningGlobe); break;
23-
case EPXAnimations.Weather: playBuffer(strip, weather); break;
24-
case EPXAnimations.ColorSpin: playBuffer(strip, smoothColorSpin); break;
22+
case EPXAnimations.Globe: writeAnimation(strip, spinningGlobe); break;
23+
case EPXAnimations.Weather: writeAnimation(strip, weather); break;
24+
case EPXAnimations.ColorSpin: writeAnimation(strip, smoothColorSpin); break;
2525
}
26+
strip.show();
2627
}
2728

28-
export function playBuffer(strip: neopixel.Strip, anim: Buffer) {
29+
//%
30+
export function writeAnimation(strip: neopixel.Strip, anim: Buffer) {
2931
const length = anim.length;
3032
let palette = [];
3133

test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
let strip = neopixel.create(DigitalPin.P0, 256, NeoPixelMode.RGB)
2-
strip.setBrightness(30);
3-
EPXDisplay.play(strip, EPXAnimations.Weather);
4-
strip.show();
2+
pins.digitalWritePin(DigitalPin.P1, 1)
3+
strip.setBrightness(30)
4+
EPXDisplay.play(strip, EPXAnimations.ColorSpin)
5+
strip.show()

0 commit comments

Comments
 (0)