Skip to content

Commit d7fe15d

Browse files
committedSep 12, 2023
Update Usage Example in Readme
1 parent 4f8d7fa commit d7fe15d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed
 

‎README.rst

+17-5
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,27 @@ To install in a virtual environment in your current project:
7777
Usage Example
7878
=============
7979

80-
At the time of writing (`git:7fc1f8ab <https://github.com/cefn/Adafruit_Micropython_Blinka/tree/7fc1f8ab477124628a5afebbf6826005955805f9>`_),
81-
the following sequence runs through some basic testing of the digitalio compatibility layer...
80+
The pin names may vary by board, so you may need to change the pin names in the code. This
81+
example runs on the Raspberry Pi boards to blink an LED connected to GPIO 18 (Pin 12):
8282

8383
.. code-block:: python
8484
85-
from testing import test_module_name
86-
test_module_name("testing.universal.digitalio")
85+
import time
86+
import board
87+
import digitalio
8788
88-
An example log from running the suites is `here <https://github.com/cefn/Adafruit_Micropython_Blinka/issues/2#issuecomment-366713394>`_ .
89+
PIN = board.D18
90+
91+
print("hello blinky!")
92+
93+
led = digitalio.DigitalInOut(PIN)
94+
led.direction = digitalio.Direction.OUTPUT
95+
96+
while True:
97+
led.value = True
98+
time.sleep(0.5)
99+
led.value = False
100+
time.sleep(0.5)
89101
90102
Contributing
91103
============

0 commit comments

Comments
 (0)
Please sign in to comment.