Skip to content

Commit b4767a3

Browse files
authored
Update README.md
1 parent 6c532c5 commit b4767a3

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
* Adafruit_BBIO supports Linux kernels 3.8 through 4.14
1010

11-
* New versions of Adafruit_BBIO may break backwards compility. Please read the [changelog](CHANGELOG.md).
11+
* New versions of Adafruit_BBIO may break backwards compatibility. Please read the [changelog](CHANGELOG.md).
1212

13-
## Installation on Debian**
13+
## Installation on Debian
1414

1515
Easiest:
1616
```
@@ -132,16 +132,47 @@ Detecting events:
132132
#read_raw returns non-normalized value
133133
value = ADC.read_raw("P9_40")
134134

135+
### [UART](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart)
136+
* Use [`config-pin` to set pin mode](https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io) for [UART1 and UART2 pins](http://beagleboard.org/static/images/cape-headers-serial.png)
137+
```
138+
config-pin P9.21 uart # UART2_TXD
139+
config-pin P9.22 uart # UART2_RXD
140+
config-pin P9.24 uart # UART1_TXD
141+
config-pin P9.26 uart # UART1_RXD
142+
```
143+
* [Install pyserial](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart#using-uart-with-python)
144+
```
145+
sudo pip install pyserial
146+
```
147+
* [Test UART1](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart#using-uart-with-python)
148+
```
149+
import Adafruit_BBIO.UART as UART
150+
import serial
151+
152+
UART.setup("UART1")
153+
154+
ser = serial.Serial(port = "/dev/ttyO1", baudrate=9600)
155+
ser.close()
156+
ser.open()
157+
if ser.isOpen():
158+
print "Serial is open!"
159+
ser.write("Hello World!")
160+
ser.close()
161+
```
162+
* [Loopback test with UART1 and UART2](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart#testing-and-using-the-uart)
163+
135164
## Running tests
136165

137166
Install py.test to run the tests. You'll also need the python compiler package for pytest:
138-
139-
pip install -U pytest
140-
167+
```
168+
sudo pip install pytest
169+
```
141170
Execute the following in the root of the project:
171+
```
172+
sudo pytest
173+
```
174+
NOTE: `sudo` should not be required when running [Debian 9.2 "Stretch" iot (2017-10-29)](https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#microSD.2FStandalone:_.28stretch-iot.29_.28All_BeagleBone_Variants_.26_PocketBeagle.29) with [Linux kernel](https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Kernel_Options) [4.14.x](https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Mainline_.284.14.x_lts.29) as udev configures group ownership and permission for [GPIO](https://github.com/rcn-ee/repos/blob/master/bb-customizations/suite/stretch/debian/80-gpio-noroot.rules) and [PWM](https://github.com/rcn-ee/repos/blob/master/bb-customizations/suite/stretch/debian/81-pwm-noroot.rules)
142175

143-
pytest
144-
145176
## Credits
146177

147178
The BeagleBone IO Python library was originally forked from the excellent MIT Licensed [RPi.GPIO](https://code.google.com/p/raspberry-gpio-python) library written by Ben Croston.

0 commit comments

Comments
 (0)