background preloader

Wiring

Wiring
Update: 14th May, 2013 wiringPi version 2 has been released and now has its own website ( to look after it. Most of the documentation on the projects site has been copied over to it the new site, but there may still be 1 or 2 pages that are still missing. I’d encourage you to use the new site if possible where there will be a forum and wiki (when I get time to implement them!) WiringPi is an Arduino wiring-like library written in C and released under the GNU LGPLv3 license which is usable from C and C++ and many other languages with suitable wrappers (See below) You may be familiar with the Arduino… Briefly; Arduino is really two things; one is a hardware platform, the other software, and part of the software is a package called Wiring. The Raspberry Pi has a 26-pin General Purpose Input/Output (GPIO) connector and this carries a set of signals and buses. WiringPi includes a command-line utility gpio which can be used to program and setup the GPIO pins. Pin numbering

wiringpi 1.0.5 A python interface to WiringPi library which allows for easily interfacing with the GPIO pins of the Raspberry Pi. Also supports i2c and SPI WiringPi: An implementation of most of the Arduino Wiring functions for the Raspberry Pi Prerequisites: You must have python-dev installed If you manually rebuild the bindings with swig -python wiringpi.i then cat wiringpi_class.py >> wiringpi.py to get the class-based wrapper Get/setup repo: git clone cd WiringPi-Python git submodule update --init Build & install with: sudo python setup.py install Class-based Usage: import wiringpi io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS) io.pinMode(1,io.OUTPUT) io.digitalWrite(1,io.HIGH) GPIO with /sys/class/gpio (You must first export the interfaces): import wiringpi io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_SYS) io.pinMode(1,io.OUTPUT) io.digitalWrite(1,io.HIGH) Serial: serial = wiringpi.Serial('/dev/ttyAMA0',9600) serial.puts("hello") serial.close() Usage:

bcm2835: C library for Broadcom BCM 2835 as used in Raspberry Pi This is a C library for Raspberry Pi (RPi). It provides access to GPIO and other IO functions on the Broadcom BCM 2835 chip, as used in the RaspberryPi, allowing access to the GPIO pins on the 26 pin IDE plug on the RPi board so you can control and interface with various external devices. It provides functions for reading digital inputs and setting digital outputs, using SPI and I2C, and for accessing the system timers. Pin event detection is supported by polling (interrupts are not supported). It is C++ compatible, and installs as a header file and non-shared library on any Linux-based distro (but clearly is no use except on Raspberry Pi or another board with BCM 2835). The version of the package that this documentation refers to can be downloaded from You can find the latest version at Several example programs are provided. Running as root Installation tar zxvf bcm2835-1.xx.tar.gz . make Reboot.

Raspberry Pi | Wiring | Pins Update: 14th May, 2013 wiringPi version 2 has been released and now has its own website ( to look after it. Most of the documentation on the projects site has been copied over to it the new site, but there may still be 1 or 2 pages that are still missing. I’d encourage you to use the new site if possible where there will be a forum and wiki. The following tables give the mapping of the Raspberry Pi GPIO Pins to the GPIO connector in relation to the pin numbers and the physical location on the connector. If using the connector pin numbering, then note that Pin 1 on the connector is the 3.3v supply. P1: The Main GPIO connector: Board Revisions: Please note the differences between board revisions 1 and 2 (R1 and R2 above) P5: The auxilliary GPIO connector present on Rev. 2 boards only: Note also that the P5 connector is designed to be used from the underside of the Pi – ie. you solder on the top of the Pi board to install the connector! Each side has three columns.

RPi Buying Guide Back to the Hub Getting Started: Buying Guide - for advice on buying the Raspberry Pi. SD Card Setup - for information on how to prepare the SD Card used to boot your Raspberry Pi. Basic Setup - for help with buying / selecting other hardware and setting it up. Beginners Guide - you are up and running, now what can you do? Advanced Setup - for more extensive information on setting up. Trouble Shooting - some things to check if things don't work as expected. Raspberry Pi has appointed Farnell, RS Components and (recently) Egoman Technology Corp[1] as its authorised manufacturing partners & distributors. As of July 16th 2012, both Premier Farnell and RS Components have removed their "one per customer" restriction. Raspberry Pi's distributors will ship worldwide to the best of their ability (ie subject to origin export and local import laws). Countries that are currently subject to UK (including EU and UN) export restrictions include North Korea, Iran, Ivory Coast, Liberia and Zimbabwe. Farnell Lion

adafruit/Adafruit-Raspberry-Pi-Python-Code WiringPi-Python Raspberry pi – Setting up auto-login and auto-loading the gui | Frustrated IT Engineer Home > How To, Raspberry pi, Technology > Raspberry pi – Setting up auto-login and auto-loading the gui Setting up Auto-Login In the GUI left click in the bottom left hand corner on the blue cross to display the options menu (Like the start button in windows) Go up to “other” and then scroll down the list until you get to “terminal” and left click You should now see the “terminal” window which is just like a cmd box in windows and enter the following command Sudo nano /etc/inittab This will open up the boot time system configuration script. Scroll down the file until you reach the line ’1:2345:resoawn:/sbin/getty 115200 tty1′ When you see that line, put a hash # in front of it to disable that line then scroll to the end of line and hit enter. In the blank line that appears add the following command 1:2345:respawn:/bin/login -f pi tty1 / dev/tty1 2>&1 Don’t forget to add the spaces and double check that the line enter is correct. Press Ctrl+X to exit followed by Y to accept the changes. Startx

RPi Low-level peripherals Back to the Hub. Hardware & Peripherals: Hardware and Hardware History. Low-level Peripherals and Expansion Boards. Screens, Cases and Other Peripherals. Introduction In addition to the familiar USB, Ethernet and HDMI ports, the Raspberry Pi offers the ability to connect directly to a variety of electronic devices. Digital outputs: turn lights, motors, or other devices on or off Digital inputs: read an on or off state from a button, switch, or other sensor Communication with chips or modules using low-level protocols: SPI, I²C, or serial UART Connections are made using GPIO ("General Purpose Input/Output") pins. Note that no analogue input or output is available. Links For further specific information about the Raspberry Pi's BCM2835 GPIOs, see: RPi BCM2835 GPIOs. Model A and B (Original) The Raspberry Pi Model A and B boards have a 26-pin 2.54 mm (100 mil)[1] expansion header, marked as P1, arranged in a 2x13 strip. Revision 1 PCBs also do not have the P5 header (see below). Useful P2 pins:

Related: