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
3535.. note :: This library is not available on PyPI yet. Install documentation is included
3636 as a standard element. Stay tuned for PyPI availability!
3737
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-
4138On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
4239PyPI <https://pypi.org/project/adafruit-circuitpython-pioasm/> `_. To install for current user:
4340
@@ -63,7 +60,30 @@ To install in a virtual environment in your current project:
6360 Usage Example
6461=============
6562
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 )
6787
6888 Contributing
6989============
Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ Table of Contents
2323.. toctree ::
2424 :caption: Tutorials
2525
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 >
2827
2928.. toctree ::
3029 :caption: Related Products
3130
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 >
3435
3536.. toctree ::
3637 :caption: Other Links
Original file line number Diff line number Diff line change 22#
33# SPDX-License-Identifier: MIT
44
5+ import time
56import rp2pio
67import board
7- import time
88import adafruit_pioasm
9- import digitalio
109
1110# NeoPixels are 800khz bit streams. Zeroes are 1/3 duty cycle (~416ns) and ones
1211# are 2/3 duty cycle (~833ns).
Original file line number Diff line number Diff line change 22#
33# SPDX-License-Identifier: MIT
44
5+ import time
56import rp2pio
67import board
7- import time
88import adafruit_pioasm
9- import digitalio
109
1110squarewave = """
1211.program squarewave
You can’t perform that action at this time.
0 commit comments