Skip to content

Commit f39a4f9

Browse files
committed
first release.
1 parent 856f384 commit f39a4f9

File tree

8 files changed

+442
-0
lines changed

8 files changed

+442
-0
lines changed

NeoPixel_RGB_16x16_Matrix.jpg

30.5 KB
Loading

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,80 @@
11
# snowflake
2+
23
makecode snow flake extension for 16x16 neopixel matrix display
4+
5+
Author: shaoziyang
6+
Date: 2018.Dec
7+
8+
![](NeoPixel_RGB_16x16_Matrix.jpg)
9+
10+
## Add extension
11+
12+
open your microbit makecode project, in Add extension, paste
13+
14+
https://github.com/makecode-extensions/snowflake
15+
16+
to search box then search.
17+
18+
19+
## Basic usage
20+
```
21+
snowflake.config(
22+
DigitalPin.P1,
23+
true,
24+
8,
25+
50,
26+
1,
27+
50
28+
)
29+
snowflake.start()
30+
```
31+
32+
## API
33+
34+
35+
- **function load_background(dat: number[])**
36+
Load a user back ground picture.
37+
You may using microbittoolbox to convert data and paste to javascript code.
38+
https://github.com/shaoziyang/microbit-lib/tree/master/utils/microbit_toolbox
39+
40+
- **function load_default_backgroud()**
41+
Load default back ground: christmas tree
42+
43+
- **function config(pin: DigitalPin, cover: boolean, threshold: number, snowfall: number, MostAtATime: number, speed: number)**
44+
configurate snow, you may adjust paramters to get different effect.
45+
* pin, which is used to control neopixel matrix
46+
* cover, enable/disable snow cover effect
47+
* threshold, snow cover threshold, range is [1-100]
48+
* snowfall, how much snow is falling, range is [1-100]
49+
* MostAtATime, new snowflake most at a time
50+
* speed, snowfall speed, the bigger the slower
51+
52+
53+
- **function start()**
54+
start/resume snowfall. Function start() need to be called only once, not in a loop.
55+
56+
- **function pause()**
57+
pause snowfall.
58+
59+
- **function reset()**
60+
restart.
61+
62+
63+
64+
## Demo
65+
66+
![](demo.png)
67+
68+
![](run.gif)
69+
70+
## License
71+
72+
MIT
73+
74+
Copyright (c) 2018, microbit/micropython Chinese community
75+
76+
## Supported targets
77+
78+
* for PXT/microbit
79+
80+
[From microbit/micropython Chinese community](http://www.micropython.org.cn)

demo.png

27.6 KB
Loading

icon.png

5.06 KB
Loading

pxt.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "snowflake",
3+
"version": "1.0.0",
4+
"description": "snowflake christmas tree extension for 16 x 16 neopixel matrix",
5+
"license": "MIT",
6+
"dependencies": {
7+
"core": "*",
8+
"neopixel": "github:microsoft/pxt-neopixel#v0.6.10"
9+
},
10+
"files": [
11+
"README.md",
12+
"snowflake.ts"
13+
],
14+
"testFiles": [
15+
"test.ts"
16+
],
17+
"public": true
18+
}

run.gif

936 KB
Loading

0 commit comments

Comments
 (0)