Skip to content

Commit efaf4ae

Browse files
committed
Merge pull request wirenboard#1 from mFoxRU/master
Update readme
2 parents bd99b75 + 04e71bf commit efaf4ae

File tree

1 file changed

+26
-46
lines changed

1 file changed

+26
-46
lines changed

README.rst

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,25 @@ It has been tested on the 5-20 and 6-6 Angstrom image on the BeagleBone Black.
1111
**Note: BBIO has been renamed to Adafruit_BBIO.**
1212

1313
**Installation on Angstrom**
14-
15-
Easiest::
16-
17-
/usr/bin/ntpdate -b -s -u pool.ntp.org
18-
opkg update && opkg install python-pip python-setuptools
19-
pip install Adafruit_BBIO
20-
21-
Manual::
22-
23-
git clone git://github.com/adafruit/adafruit-beaglebone-io-python.git
14+
::
15+
git clone git://github.com/contactless/wb-io-python.git
2416
#set the date and time
2517
/usr/bin/ntpdate -b -s -u pool.ntp.org
2618
#install dependency
2719
opkg update && opkg install python-distutils
28-
cd adafruit-beaglebone-io-python
20+
cd wb-io-python
2921
python setup.py install
3022

3123
**Installation on Ubuntu/Debian**
32-
33-
Easiest::
34-
24+
::
3525
sudo ntpdate pool.ntp.org
3626
sudo apt-get update
3727
sudo apt-get install build-essential python-dev python-pip -y
38-
#easy_install -U distribute //debian only
39-
sudo pip install Adafruit_BBIO
40-
41-
Manual::
42-
43-
sudo ntpdate pool.ntp.org
44-
sudo apt-get update
45-
sudo apt-get install build-essential python-dev python-pip -y
46-
git clone git://github.com/adafruit/adafruit-beaglebone-io-python.git
47-
cd adafruit-beaglebone-io-python
28+
git clone git://github.com/contactless/wb-io-python.git
29+
cd wb-io-python
4830
sudo python setup.py install
4931
cd ..
50-
sudo rm -rf adafruit-beaglebone-io-python
32+
sudo rm -rf wb-io-python
5133
5234
**Usage**
5335

@@ -57,30 +39,28 @@ Using the library is very similar to the excellent RPi.GPIO library used on the
5739

5840
Import the library, and setup as GPIO.OUT or GPIO.IN::
5941

60-
import Adafruit_BBIO.GPIO as GPIO
61-
GPIO.setup("P8_14", GPIO.OUT)
62-
63-
You can also refer to the pin names::
42+
import WB_IO.GPIO as GPIO
43+
GPIO.setup(247, GPIO.OUT)
6444

65-
GPIO.setup("GPIO0_26", GPIO.OUT)
45+
Here, 247 is a GPIO id for Relay 1 on Wiren Board Smart Home rev. 3.5. List of all GPIO id avaliable on http://contactless.ru/wiki
6646

6747
**GPIO Output**
6848

6949
Setup the pin for output, and write GPIO.HIGH or GPIO.LOW. Or you can use 1 or 0.::
7050

71-
import Adafruit_BBIO.GPIO as GPIO
72-
GPIO.setup("P8_14", GPIO.OUT) GPIO.output("P8_14", GPIO.HIGH)
51+
import WB_IO.GPIO as GPIO
52+
GPIO.setup(247, GPIO.OUT) GPIO.output(247, GPIO.HIGH)
7353
7454
**GPIO Input**
7555

7656
Inputs work similarly to outputs.::
7757

78-
import Adafruit_BBIO.GPIO as GPIO
79-
GPIO.setup("P8_14", GPIO.IN)
58+
import WB_IO.GPIO as GPIO
59+
GPIO.setup(id, GPIO.IN)
8060
8161
Polling inputs::
8262
83-
if GPIO.input("P8_14"):
63+
if GPIO.input(id):
8464
print("HIGH")
8565
else:
8666
print("LOW")
@@ -91,37 +71,37 @@ Waiting for an edge (GPIO.RISING, GPIO.FALLING, or GPIO.BOTH::
9171

9272
Detecting events::
9373

94-
GPIO.add_event_detect("P9_12", GPIO.FALLING)
74+
GPIO.add_event_detect(id, GPIO.FALLING)
9575
#your amazing code here
9676
#detect wherever:
97-
if GPIO.event_detected("P9_12"):
77+
if GPIO.event_detected(id):
9878
print "event detected!"
9979

10080
**PWM**::
10181

102-
import Adafruit_BBIO.PWM as PWM
82+
import WB_IO.PWM as PWM
10383
#PWM.start(channel, duty, freq=2000, polarity=0)
10484
#duty values are valid 0 (off) to 100 (on)
105-
PWM.start("P9_14", 50)
106-
PWM.set_duty_cycle("P9_14", 25.5)
107-
PWM.set_frequency("P9_14", 10)
85+
PWM.start(id, 50)
86+
PWM.set_duty_cycle(id, 25.5)
87+
PWM.set_frequency(id, 10)
10888

109-
PWM.stop("P9_14")
89+
PWM.stop(id)
11090
PWM.cleanup()
11191
11292
#set polarity to 1 on start:
113-
PWM.start("P9_14", 50, 2000, 1)
93+
PWM.start(id, 50, 2000, 1)
11494

11595
**ADC**::
11696

117-
import Adafruit_BBIO.ADC as ADC
97+
import WB_IO.ADC as ADC
11898
ADC.setup()
11999

120100
#read returns values 0-1.0
121-
value = ADC.read("P9_40")
101+
value = ADC.read(id)
122102

123103
#read_raw returns non-normalized value
124-
value = ADC.read_raw("P9_40")
104+
value = ADC.read_raw(id)
125105

126106
**Running tests**
127107

0 commit comments

Comments
 (0)