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

Commit b11faf4

Browse files
committed
add back powerup-clear
1 parent 414e141 commit b11faf4

3 files changed

Lines changed: 25 additions & 10 deletions

File tree

EPXDisplay.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,27 @@ namespace EPXDisplay {
1919
//% weight=88
2020
export function play(strip: neopixel.Strip, anim: EPXAnimations) {
2121
switch(anim) {
22-
case EPXAnimations.Globe: writeAnimation(strip, spinningGlobe); break;
23-
case EPXAnimations.Weather: writeAnimation(strip, weather); break;
24-
case EPXAnimations.ColorSpin: writeAnimation(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, ColorSpin); break;
2525
}
2626
strip.show();
2727
}
2828

29+
/**
30+
* Turn off all LEDs.
31+
* You need to call ``show`` to make the changes visible.
32+
*/
33+
//% blockId="EPXDisplay_powerupclear" block="$strip=variables_get(strip)|powerupclear with brightness %brightness "
34+
//% help=github:github.com/microsoft/ExpressivePixelsMakeCode/blob/master/HelpStartup.md
35+
//% weight=89
36+
export function powerupclear(strip: neopixel.Strip, brightness: number): void {
37+
strip.setBrightness(brightness);
38+
strip.clear();
39+
pause(1);
40+
strip.show();
41+
}
42+
2943
//%
3044
export function writeAnimation(strip: neopixel.Strip, anim: Buffer) {
3145
const length = anim.length;

0 commit comments

Comments
 (0)