Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:c_tinkering [2016/02/29 14:31] john1117 [Python example] |
en:c_tinkering [2017/03/02 09:55] (current) brian.kim [Python example] |
||
---|---|---|---|
Line 32: | Line 32: | ||
===== Linux ===== | ===== Linux ===== | ||
- | ==== C example ==== | + | ==== C example (With WiringPi) ==== |
1. Get the wiringPi library compatible **ODROID** | 1. Get the wiringPi library compatible **ODROID** | ||
+ | sudo apt update && sudo apt install git | ||
git clone https://github.com/hardkernel/wiringPi | git clone https://github.com/hardkernel/wiringPi | ||
Line 55: | Line 56: | ||
**Prerequisites**: You must have //**python-dev**// and //**python-setuptools**// installed If you manually rebuild the bindings with swig-python wiringpi.i | **Prerequisites**: You must have //**python-dev**// and //**python-setuptools**// installed If you manually rebuild the bindings with swig-python wiringpi.i | ||
- | sudo apt-get install python-dev python-setuptools | + | sudo apt-get install python-dev python-setuptools swig3.0 |
| | ||
1. Get/setup WiringPi 2 for Python repository | 1. Get/setup WiringPi 2 for Python repository | ||
Line 67: | Line 68: | ||
2. Build & install | 2. Build & install | ||
- | sudo python setup.py install | + | <code> |
+ | swig3.0 -python -threads wiringpi.i | ||
+ | sudo python setup.py install | ||
+ | </code> | ||
+ | Or | ||
+ | <code> | ||
+ | ./build.sh | ||
+ | </code> | ||
3. Get/Run the example source code | 3. Get/Run the example source code |