Skip to content

Commit 92bd611

Browse files
authored
Merge pull request #2 from adafruit/master
Sync from upstream
2 parents 1fdedc5 + 0e593a1 commit 92bd611

File tree

4 files changed

+20
-77
lines changed

4 files changed

+20
-77
lines changed

Adafruit_BBIO/Encoder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import sysfs
88
import platform
99

10-
if not platform.release().startswith('4.4'):
10+
(major, minor, patch) = platform.release().split("-")[0].split(".")
11+
if not (int(major) >= 4 and int(minor) >= 4):
1112
raise ImportError(
1213
'The Encoder module requires Linux kernel version >= 4.4.x.\n'
1314
'Please upgrade your kernel to use this module.\n'

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ sudo pip install --upgrade Adafruit_BBIO
3939

4040
Using the library is very similar to the excellent RPi.GPIO library used on the Raspberry Pi. Below are some examples.
4141

42+
### Pin Numbers
43+
44+
Please note that there is no '0' prefix for the pin numbers. For example, pin 7 on header P8 is `P8_7`.
45+
46+
**Correct:**
47+
```
48+
GPIO.setup("P8_7", OUT )
49+
```
50+
51+
**INCORRECT:**
52+
```
53+
GPIO.setup("P8_07", OUT )
54+
```
55+
56+
Refer to `pins_t table[]` in [common.c](https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73) all the pin labels.
57+
4258
### config-pin
4359

4460
[config-pin](https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io) is now used on the official BeagleBoard.org Debian Jessie and Stretch images to control pin mode (e.g. pin mux).

source/py_pwm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ static const char moduledocstring[] = "PWM functionality of a BeagleBone using P
217217
PyMethodDef pwm_methods[] = {
218218
{"start", (PyCFunction)py_start_channel, METH_VARARGS | METH_KEYWORDS, "Set up and start the PWM channel. channel can be in the form of 'P8_10', or 'EHRPWM2A'"},
219219
{"stop", (PyCFunction)py_stop_channel, METH_VARARGS | METH_KEYWORDS, "Stop the PWM channel. channel can be in the form of 'P8_10', or 'EHRPWM2A'"},
220-
{ "set_duty_cycle", (PyCFunction)py_set_duty_cycle, METH_VARARGS, "Change the duty cycle\ndutycycle - between 0.0 and 100.0" },
221-
{ "set_frequency", (PyCFunction)py_set_frequency, METH_VARARGS, "Change the frequency\nfrequency - frequency in Hz (freq > 0.0)" },
220+
{ "set_duty_cycle", (PyCFunction)py_set_duty_cycle, METH_VARARGS | METH_KEYWORDS, "Change the duty cycle\ndutycycle - between 0.0 and 100.0" },
221+
{ "set_frequency", (PyCFunction)py_set_frequency, METH_VARARGS | METH_KEYWORDS, "Change the frequency\nfrequency - frequency in Hz (freq > 0.0)" },
222222
{"cleanup", py_cleanup, METH_VARARGS, "Clean up by resetting all GPIO channels that have been used by this program to INPUT with no pullup/pulldown and no event detection"},
223223
//{"setwarnings", py_setwarnings, METH_VARARGS, "Enable or disable warning messages"},
224224
{NULL, NULL, 0, NULL}

test/test_rotary.py

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)