File tree Expand file tree Collapse file tree 4 files changed +31
-12
lines changed Expand file tree Collapse file tree 4 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,6 @@ Installing from PyPI
35
35
.. note :: This library is not available on PyPI yet. Install documentation is included
36
36
as a standard element. Stay tuned for PyPI availability!
37
37
38
- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
39
- If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
40
-
41
38
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
42
39
PyPI <https://pypi.org/project/adafruit-circuitpython-pioasm/> `_. To install for current user:
43
40
@@ -63,7 +60,30 @@ To install in a virtual environment in your current project:
63
60
Usage Example
64
61
=============
65
62
66
- .. todo :: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
63
+ .. code-block :: python
64
+
65
+ import time
66
+ import rp2pio
67
+ import board
68
+ import adafruit_pioasm
69
+
70
+ squarewave = """
71
+ .program squarewave
72
+ set pins 1 [1] ; Drive pin high and then delay for one cycle
73
+ set pins 0 ; Drive pin low
74
+ """
75
+
76
+ assembled = adafruit_pioasm.assemble(squarewave)
77
+
78
+ sm = rp2pio.StateMachine(
79
+ assembled,
80
+ frequency = 80 ,
81
+ init = adafruit_pioasm.assemble(" set pindirs 1" ),
82
+ first_set_pin = board.LED ,
83
+ )
84
+ print (" real frequency" , sm.frequency)
85
+
86
+ time.sleep(120 )
67
87
68
88
Contributing
69
89
============
Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ Table of Contents
23
23
.. toctree ::
24
24
:caption: Tutorials
25
25
26
- .. todo :: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27
- the toctree above for use later.
26
+ Getting Started with Raspberry Pi Pico and CircuitPython <https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython >
28
27
29
28
.. toctree ::
30
29
:caption: Related Products
31
30
32
- .. todo :: Add any product links here. If there are none, then simply delete this todo and leave
33
- the toctree above for use later.
31
+ Adafruit ItsyBitsy RP2040 <https://www.adafruit.com/product/4888 >
32
+ Adafruit Feather RP2040 <https://www.adafruit.com/product/4884 >
33
+ Raspberry Pi Pico RP2040 <https://www.adafruit.com/product/4864 >
34
+ Raspberry Pi Pico RP2040 with Loose Headers <https://www.adafruit.com/product/4883 >
34
35
35
36
.. toctree ::
36
37
:caption: Other Links
Original file line number Diff line number Diff line change 2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
5
+ import time
5
6
import rp2pio
6
7
import board
7
- import time
8
8
import adafruit_pioasm
9
- import digitalio
10
9
11
10
# NeoPixels are 800khz bit streams. Zeroes are 1/3 duty cycle (~416ns) and ones
12
11
# are 2/3 duty cycle (~833ns).
Original file line number Diff line number Diff line change 2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
5
+ import time
5
6
import rp2pio
6
7
import board
7
- import time
8
8
import adafruit_pioasm
9
- import digitalio
10
9
11
10
squarewave = """
12
11
.program squarewave
You can’t perform that action at this time.
0 commit comments