File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,27 @@ To install in a virtual environment in your current project:
77
77
Usage Example
78
78
=============
79
79
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):
82
82
83
83
.. code-block :: python
84
84
85
- from testing import test_module_name
86
- test_module_name(" testing.universal.digitalio" )
85
+ import time
86
+ import board
87
+ import digitalio
87
88
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 )
89
101
90
102
Contributing
91
103
============
You can’t perform that action at this time.
0 commit comments