Skip to content

Commit 9dd5d5b

Browse files
committed
Add mip support
1 parent ac34d25 commit 9dd5d5b

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,36 @@ For example, the Seeed Studio [Grove - Chainable RGB LED](https://wiki.seeedstud
66

77
![demo](docs/demo.jpg)
88

9-
## Example
109

11-
Copy the file to your device, using ampy, webrepl or compiling and deploying. eg.
10+
### Installation
1211

12+
Using mip via mpremote:
13+
14+
```bash
15+
$ mpremote mip install github:mcauser/micropython-p9813
16+
$ mpremote mip install github:mcauser/micropython-p9813/examples
1317
```
14-
$ ampy put p9813.py
18+
19+
Using mip directly on a WiFi capable board:
20+
21+
```python
22+
>>> import mip
23+
>>> mip.install("github:mcauser/micropython-p9813")
24+
>>> mip.install("github:mcauser/micropython-p9813/examples")
1525
```
1626

27+
Manual installation:
28+
29+
Copy `src/p9813.py` to the root directory of your device.
30+
31+
32+
## SPI Version
33+
34+
You can use either HSPI or SPI. This version is significantly faster than the
35+
bit-bang version. MISO is not used. The LED driver is write only.
36+
37+
### SPI Example
38+
1739
**Basic usage**
1840

1941
```python
@@ -126,7 +148,15 @@ chain[2:] = [(0, 0, 255)] * 8
126148
chain.reset()
127149
```
128150

129-
See [p9813_examples.py](p9813_examples.py) and [examples](examples/) for more.
151+
For more detailed examples, see [examples](/examples).
152+
153+
If you mip installed them above, you can run them like so:
154+
155+
```python
156+
import p9813.examples.basic
157+
```
158+
159+
130160
## Chaining
131161

132162
You can connect multiple LEDs together to form a chain.

examples/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"urls": [
3+
["p9813/examples/auto_write.py", "github:mcauser/micropython-p9813/examples/auto_write.py"],
4+
["p9813/examples/basic.py", "github:mcauser/micropython-p9813/examples/basic.py"],
5+
["p9813/examples/bitbang.py", "github:mcauser/micropython-p9813/examples/bitbang.py"],
6+
["p9813/examples/bounce.py", "github:mcauser/micropython-p9813/examples/bounce.py"],
7+
["p9813/examples/color_wipe.py", "github:mcauser/micropython-p9813/examples/color_wipe.py"],
8+
["p9813/examples/cycle.py", "github:mcauser/micropython-p9813/examples/cycle.py"],
9+
["p9813/examples/fade.py", "github:mcauser/micropython-p9813/examples/fade.py"],
10+
["p9813/examples/fill.py", "github:mcauser/micropython-p9813/examples/fill.py"],
11+
["p9813/examples/hw_spi.py", "github:mcauser/micropython-p9813/examples/hw_spi.py"],
12+
["p9813/examples/level.py", "github:mcauser/micropython-p9813/examples/level.py"],
13+
["p9813/examples/rainbow_cycle.py", "github:mcauser/micropython-p9813/examples/rainbow_cycle.py"],
14+
["p9813/examples/rainbow_fade.py", "github:mcauser/micropython-p9813/examples/rainbow_fade.py"],
15+
["p9813/examples/rainbow.py", "github:mcauser/micropython-p9813/examples/rainbow.py"],
16+
["p9813/examples/random.py", "github:mcauser/micropython-p9813/examples/random.py"],
17+
["p9813/examples/rgb.py", "github:mcauser/micropython-p9813/examples/rgb.py"],
18+
["p9813/examples/slice.py", "github:mcauser/micropython-p9813/examples/slice.py"],
19+
["p9813/examples/sw_spi.py", "github:mcauser/micropython-p9813/examples/sw_spi.py"],
20+
["p9813/examples/theater_chase_rainbow.py", "github:mcauser/micropython-p9813/examples/theater_chase_rainbow.py"],
21+
["p9813/examples/theater_chase.py", "github:mcauser/micropython-p9813/examples/theater_chase.py"],
22+
["p9813/examples/traffic_lights.py", "github:mcauser/micropython-p9813/examples/traffic_lights.py"]
23+
],
24+
"deps": [],
25+
"version": "2.0.0"
26+
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"urls": [
3+
["p9813/__init__.py", "github:mcauser/micropython-p9813/src/p9813.py"]
4+
],
5+
"deps": [],
6+
"version": "2.0.0"
7+
}

0 commit comments

Comments
 (0)