<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=RPI_Programming</id>
	<title>RPI Programming - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=RPI_Programming"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=RPI_Programming&amp;action=history"/>
	<updated>2026-07-22T15:48:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=RPI_Programming&amp;diff=31427&amp;oldid=prev</id>
		<title>Chao: /* Python */</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=RPI_Programming&amp;diff=31427&amp;oldid=prev"/>
		<updated>2021-05-27T03:58:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Python&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* [[RPI Hardware]]&lt;br /&gt;
&lt;br /&gt;
== Github ==&lt;br /&gt;
* https://github.com/Edragon/RPI&lt;br /&gt;
* https://github.com/Edragon/RPI_Display&lt;br /&gt;
== Setup == &lt;br /&gt;
* raspi-config -&amp;gt; sudo raspi-config -&amp;gt; Interfacing Options -&amp;gt; SPI -&amp;gt; Yes&lt;br /&gt;
=== Packages ===&lt;br /&gt;
Install BCM2835&lt;br /&gt;
 wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.59.tar.gz&lt;br /&gt;
 tar zxvf bcm2835-1.59.tar.gz&lt;br /&gt;
 cd bcm2835-1.59&lt;br /&gt;
 ./configure&lt;br /&gt;
 make&lt;br /&gt;
 sudo make check&lt;br /&gt;
 sudo make install&lt;br /&gt;
Install WiringPi&lt;br /&gt;
 cd&lt;br /&gt;
 git clone git://git.drogon.net/wiringPi&lt;br /&gt;
 cd ~/wiringPi&lt;br /&gt;
 git pull origin&lt;br /&gt;
 ./build&lt;br /&gt;
Python2&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo apt-get install python-pil&lt;br /&gt;
 sudo apt-get install python-numpy&lt;br /&gt;
 sudo pip install RPi.GPIO&lt;br /&gt;
Python3&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install python3-pip&lt;br /&gt;
 sudo apt-get install python3-pil&lt;br /&gt;
 sudo apt-get install python3-numpy&lt;br /&gt;
 sudo pip3 install RPi.GPIO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPIO Wiring ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Raspberry-Pi-GPIO-pinouts.png | For python RPi.GPIO, this is setup as GPIO.BCM&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
== WiringPi ==&lt;br /&gt;
* Reference information at http://wiringpi.com/examples/blink/&lt;br /&gt;
&lt;br /&gt;
If you do not have GIT installed, then under any of the Debian releases (e.g. Raspbian), you can install it with:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git-core&lt;br /&gt;
If you get any errors here, make sure your Pi is up to date with the latest versions of Raspbian:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
To obtain WiringPi using GIT:&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.drogon.net/wiringPi&lt;br /&gt;
If you have already used the clone operation for the first time, then&lt;br /&gt;
&lt;br /&gt;
 cd wiringPi&lt;br /&gt;
 git pull origin&lt;br /&gt;
Will fetch an updated version then you can re-run the build script below.&lt;br /&gt;
&lt;br /&gt;
To build/install there is a new simplified script:&lt;br /&gt;
&lt;br /&gt;
 cd wiringPi&lt;br /&gt;
 ./build&lt;br /&gt;
The new build script will compile and install it all for you – it does use the sudo command at one point, so you may wish to inspect the script before running it.&lt;br /&gt;
&lt;br /&gt;
== Hardware Config ==&lt;br /&gt;
* Turn on SPI, IIC option is raspi-config -&amp;gt; advanced option&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* Adafruit python library https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git&lt;br /&gt;
* python GPIO module wiki explanation http://sourceforge.net/p/raspberry-gpio-python/wiki/Examples/&lt;br /&gt;
=== Common used commands and program ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command !! description !! example 1 !! example 2&lt;br /&gt;
|-&lt;br /&gt;
| top  || show current running process || - || -&lt;br /&gt;
|-&lt;br /&gt;
| chmod|| change the right of directory or file || chmod a+x 111.log || chmod -R u+x test4 (change test4 folder and all files, subfolder right)&lt;br /&gt;
|-&lt;br /&gt;
| cp || copy file or directory || cp -r CharLCD /home/pi (copy folder CharLCD to directly /home/pi, -r to keep construe of the folder)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Raspbian ==&lt;br /&gt;
* Download raspbian image, install it using win32diskimager - http://sourceforge.net/projects/win32diskimager/&lt;br /&gt;
*&lt;br /&gt;
[[category:Raspberry Pi]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>