SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Python auf dem Raspberry Pi
Thomas Koch @tomy_koch
PythonCamp, Köln, Mai 2013
Agenda
 Specs:
 Was ist der Raspberry Pi ?
 Anwendungen:
 Was kann der Raspberry Pi ?
 GPIO mit Python
 Programmierung & Beispiele
 Weitere Infos
 Links, Literatur
05/2013Thomas Koch
Einführung: Der Raspberry Pi
Grundlagen
 SOC Minicomputer: "System on a chip"
 512 MB Hauptspeicher und 700 MHZ ARM CPU
 Ethernet-Schnittstelle und zwei USB-Anschlüsse (Modell B)
 "BYOP"-Prinzip: "bring your own peripherals“
 Lieferung ohne Maus,Tastatur, Netzstecker etc.
 Nackte Platine (ohne Gehäuse), ohne SD-Card/OS
 Einschränkungen
 keine Uhr
 kein BIOS (d.h. Raspi kann NUR von SD-Card booten)
05/2013Thomas Koch
Hardware: Der Raspberry Pi
05/2013Thomas Koch
 Das Board
 GPIO (General Purpose Input/Output)
 CSI (Camera Serial Interface)
 DVI-Out
 OS
 Raspbian (Debian)
 Arch Linux
 RISC OS
Anwendungsmöglichkeiten
 Network Device
 Print- und Webserver, VPN-Server, DHCP-Server etc.
 Cloud für eigenes Netzwerk
 Raspberry Pi als Mediacenter
 XBMC basierende Distributionen wie OpenELEC, Raspbmc
 Oder auch als AirPlay Empfänger
 Remote Control
 Steuereinheit für eigene Roboter oder Luftfahrzeuge
 Home Automation
 Alarm Anlage
 Kiosk-Systeme
 eingebauterWeb-Browser "midori" bietetVollbildmodus
$ midori -e Fullscreen -a <URL>
http://lifehacker.com/5978871/ten-more-awesome-projects-for-your-raspberry-pi
Anwendungsbeispiele
05/2013Thomas Koch
 Jumbo Digital Picture Frame
http://raspberrypihobbyist.blogspot.de/2013/02/jumbo-digital-picture-frame.html
Anwendungsbeispiele
05/2013Thomas Koch
 Roboter-Steuerung per Spracheingabe!
http://www.youtube.com/watch?v=_U_v9tRD68k
Anwendungsbeispiele
05/2013Thomas Koch
 MAME Arcade Table
 http://www.instructables.com/id/Coffee-Table-Pi
Mini Tutorial
05/2013Thomas Koch
 Erste Schritte
 Raspian auf SD-Karte „installieren“ und einstecken
 Einstecken (kein An/Aus-Schalter!)
 Login: user: pi / pwd: raspberry (Tipp: passwd ,-)
 Desktop-GUI: startx
 Debian basics
 $ apt-get update
 $ apt-get upgrade
 $ apt-get install <pkg>
 $ apt-get autoclean
Mini Tutorial II
05/2013Thomas Koch
 Konfiguration:
 $ raspi-config
 ‘enable ssh’
 ‘change_pass ‘  change system password (for the user 'pi')
http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview
 nützliche Debian Pakete
 für GPIO: "WiringPi"
https://projects.drogon.net/raspberry-pi/wiringpi/
 $ sudo apt-get install git-core
 $ git clone git://git.drogon.net/wiringPi
GPIO Basics
05/2013Thomas Koch
 GPIO perWiringPI steuern
 Ports per WiringPI ansteuern
 command-line utility gpio
 can be used to program and setup
the GPIO pins
 pi@raspi ~ $ gpio readall
 Python-Bindings
 Bindings für GPIO-Projekt
WiringPi auf github:
https://github.com/WiringPi/WiringPi-Python
+----------+------+--------+------+-------+
| wiringPi | GPIO | Name | Mode | Value |
+----------+------+--------+------+-------+
| 0 | 17 | GPIO 0 | IN | Low |
| 1 | 18 | GPIO 1 | IN | Low |
| 2 | 27 | GPIO 2 | OUT | Low |
| 3 | 22 | GPIO 3 | IN | Low |
| 4 | 23 | GPIO 4 | IN | Low |
| 5 | 24 | GPIO 5 | IN | Low |
| 6 | 25 | GPIO 6 | IN | Low |
| 7 | 4 | GPIO 7 | IN | Low |
| 8 | 2 | SDA | ALT0 | High |
| 9 | 3 | SCL | ALT0 | High |
| 10 | 8 | CE0 | IN | Low |
| 11 | 7 | CE1 | IN | Low |
| 12 | 10 | MOSI | IN | Low |
| 13 | 9 | MISO | IN | Low |
| 14 | 11 | SCLK | IN | Low |
| 15 | 14 | TxD | ALT0 | High |
| 16 | 15 | RxD | ALT0 | High |
| 17 | 28 | GPIO 8 | IN | Low |
| 18 | 29 | GPIO 9 | IN | Low |
| 19 | 30 | GPIO10 | IN | Low |
| 20 | 31 | GPIO11 | IN | Low |
+----------+------+--------+------+-------+
$ gpio mode 0 out
$ gpio write 0 1
$ gpio write 0 0
Python auf dem Raspberry PI
05/2013Thomas Koch
 Python included
 Raspi kommt mit Python 2.7 und 3.2
 und pygame http://www.pygame.org/
 GPIO mit Python
 simple GPIO PythonWrapper: RPi.GPIO
 A module to control Raspberry Pi GPIO channels
 includes a C extension
 any script using RPi.GPIO must run with root privileges!
 https://pypi.python.org/pypi/RPi.GPIO
Code-Beispiele
Demonstration
05/2013Thomas Koch
Beispiel: WiringPi
05/2013Thomas Koch
 Serielle Schnittstellte
 GPIO bietet pins für 'transmit' signal (TxD) and 'receive' signal (RxD)
 Achtung: Raspberry Pi verwendet 0 – 3.3V level (RS-232: +/-12V)
 serialOpen: Requires device/baud and returns an ID
 https://projects.drogon.net/raspberry-pi/wiringpi/
 http://elinux.org/RPi_Serial_Connection
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
wiringpi.serialPuts(serial,"hello")
wiringpi.serialClose(serial) // Pass in ID
Beispiel: RPi.GPIO
05/2013Thomas Koch
 LED einschalten
 http://elinux.org/RPi_Low-level_peripherals#Python
 https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/
import RPi.GPIO as GPIO
# header pin numbering BCM GPIO 00..nn
GPIO.setmode(GPIO.BCM)
# Set up the GPIO channels:
# one input and one output
GPIO.setup(17, GPIO.IN)
GPIO.setup(18, GPIO.OUT)
input_value = GPIO.input(17)
print „pin#17 is“, input_value
GPIO.output(18, GPIO.HIGH)
Weiterführende Links/ Infos
 Websites
 Raspberry Foundation
 http://www.raspberrypi.org
 Adafruit (Tutorials, hardware kits, etc.)
 http://learn.adafruit.com
 Embedded LinuxWiki http://elinux.org
 Online-Magazin: http://www.themagpi.com
 Literatur
 Raspberry Pi - Einstieg • Optimierung • Projekte
Maik Schmitd, dpunkt verlag, http://www.dpunkt.de/raspi
 Getting Started with Raspberry Pi
http://blog.makezine.com/2012/12/25/ten-raspberry-pi-tips
Verlag: o'reilly/makers
05/2013Thomas Koch

Weitere ähnliche Inhalte

Andere mochten auch

Seminar Presentation on raspberry pi
Seminar Presentation on raspberry piSeminar Presentation on raspberry pi
Seminar Presentation on raspberry piGeorgekutty Francis
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi PresentationGeekizer
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pipraveen_23
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introductionLTG Oxford
 
Heizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusHeizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusPeter Eulberg
 

Andere mochten auch (6)

Seminar Presentation on raspberry pi
Seminar Presentation on raspberry piSeminar Presentation on raspberry pi
Seminar Presentation on raspberry pi
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi Presentation
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introduction
 
Heizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire BusHeizungsmonitoring mit 1-wire Bus
Heizungsmonitoring mit 1-wire Bus
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 

Ähnlich wie Einführung in Raspberry Pi und GPIO

Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Andreas Zilly
 
DevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenDevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenFotiosKaramitsos
 
Moderne abap entwicklung mit abapGit
Moderne abap entwicklung mit abapGitModerne abap entwicklung mit abapGit
Moderne abap entwicklung mit abapGitChristian Günter
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutterroskakori
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas Hirt
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas HirtFMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas Hirt
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas HirtVerein FM Konferenz
 
C / C++ Api for Beginners
C / C++ Api for BeginnersC / C++ Api for Beginners
C / C++ Api for BeginnersUlrich Krause
 
Systemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanSystemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanB1 Systems GmbH
 
C API for Lotus Notes & Domino
C API for Lotus Notes & DominoC API for Lotus Notes & Domino
C API for Lotus Notes & DominoUlrich Krause
 
System- & Konfigurationsmanagement mit Foreman & Puppet
System- & Konfigurationsmanagement mit Foreman & Puppet System- & Konfigurationsmanagement mit Foreman & Puppet
System- & Konfigurationsmanagement mit Foreman & Puppet B1 Systems GmbH
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuWerner Fischer
 
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang Barth
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang BarthOSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang Barth
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang BarthNETWAYS
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...NETWAYS
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...NETWAYS
 
TYPO3 Usergroup Dresden - TYPO3 & Composer
TYPO3 Usergroup Dresden - TYPO3 & ComposerTYPO3 Usergroup Dresden - TYPO3 & Composer
TYPO3 Usergroup Dresden - TYPO3 & ComposerAxel Böswetter
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringNETWAYS
 

Ähnlich wie Einführung in Raspberry Pi und GPIO (20)

Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5Raspberry Pi Zero als USB Gadget - Pi and more 10.5
Raspberry Pi Zero als USB Gadget - Pi and more 10.5
 
DevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigenDevOps: Automatisieren, was wir predigen
DevOps: Automatisieren, was wir predigen
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 
G&L Tech News 02/17
G&L Tech News 02/17G&L Tech News 02/17
G&L Tech News 02/17
 
IoT und Smarthome
IoT und Smarthome IoT und Smarthome
IoT und Smarthome
 
Moderne abap entwicklung mit abapGit
Moderne abap entwicklung mit abapGitModerne abap entwicklung mit abapGit
Moderne abap entwicklung mit abapGit
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutter
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas Hirt
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas HirtFMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas Hirt
FMK2015: Erste Schritte mit einem Codeversionierungssystem by Thomas Hirt
 
C / C++ Api for Beginners
C / C++ Api for BeginnersC / C++ Api for Beginners
C / C++ Api for Beginners
 
Systemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und ForemanSystemmanagement mit Puppet und Foreman
Systemmanagement mit Puppet und Foreman
 
Dev + Ops = Go
Dev + Ops = GoDev + Ops = Go
Dev + Ops = Go
 
C API for Lotus Notes & Domino
C API for Lotus Notes & DominoC API for Lotus Notes & Domino
C API for Lotus Notes & Domino
 
System- & Konfigurationsmanagement mit Foreman & Puppet
System- & Konfigurationsmanagement mit Foreman & Puppet System- & Konfigurationsmanagement mit Foreman & Puppet
System- & Konfigurationsmanagement mit Foreman & Puppet
 
Tk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneuTk roadschow-ipmi-pdeneu
Tk roadschow-ipmi-pdeneu
 
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang Barth
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang BarthOSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang Barth
OSMC 2010 | Netzwerkmonitoring mit Argus by Wolfgang Barth
 
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
Nagios Conference 2006 | SAP Monitoring II - Die technische Umsetzung by Wolf...
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
 
TYPO3 Usergroup Dresden - TYPO3 & Composer
TYPO3 Usergroup Dresden - TYPO3 & ComposerTYPO3 Usergroup Dresden - TYPO3 & Composer
TYPO3 Usergroup Dresden - TYPO3 & Composer
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
 

Mehr von Thomas Koch

CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeThomas Koch
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrThomas Koch
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtThomas Koch
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipseThomas Koch
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzThomas Koch
 
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemThomas Koch
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Thomas Koch
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrThomas Koch
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011Thomas Koch
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo ToolkitThomas Koch
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Thomas Koch
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLuceneThomas Koch
 

Mehr von Thomas Koch (12)

CI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python CodeCI Signal Light in less than 100 Line of Python Code
CI Signal Light in less than 100 Line of Python Code
 
Facettensuche mit Lucene und Solr
Facettensuche mit Lucene und SolrFacettensuche mit Lucene und Solr
Facettensuche mit Lucene und Solr
 
BSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemachtBSCW - Teamarbeit leicht gemacht
BSCW - Teamarbeit leicht gemacht
 
Python-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und EclipsePython-IDEs - PyDev und Eclipse
Python-IDEs - PyDev und Eclipse
 
Pandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen EinsatzPandas und matplotlib im praktischen Einsatz
Pandas und matplotlib im praktischen Einsatz
 
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes ForschungsinformationssystemEnArgus – ein ontologiebasiertes Forschungsinformationssystem
EnArgus – ein ontologiebasiertes Forschungsinformationssystem
 
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
Wissenserschließung und –Modellierung: Ontologie vs. Volltextsuche am Beispie...
 
Volltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und SolrVolltextsuche mit Lucene und Solr
Volltextsuche mit Lucene und Solr
 
PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011PyLucene@PyCon DE 2011
PyLucene@PyCon DE 2011
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo Toolkit
 
Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008) Teamarbeit 2.0 (PTF 2008)
Teamarbeit 2.0 (PTF 2008)
 
Suche und PyLucene
Suche und PyLuceneSuche und PyLucene
Suche und PyLucene
 

Einführung in Raspberry Pi und GPIO

  • 1. Python auf dem Raspberry Pi Thomas Koch @tomy_koch PythonCamp, Köln, Mai 2013
  • 2. Agenda  Specs:  Was ist der Raspberry Pi ?  Anwendungen:  Was kann der Raspberry Pi ?  GPIO mit Python  Programmierung & Beispiele  Weitere Infos  Links, Literatur 05/2013Thomas Koch
  • 3. Einführung: Der Raspberry Pi Grundlagen  SOC Minicomputer: "System on a chip"  512 MB Hauptspeicher und 700 MHZ ARM CPU  Ethernet-Schnittstelle und zwei USB-Anschlüsse (Modell B)  "BYOP"-Prinzip: "bring your own peripherals“  Lieferung ohne Maus,Tastatur, Netzstecker etc.  Nackte Platine (ohne Gehäuse), ohne SD-Card/OS  Einschränkungen  keine Uhr  kein BIOS (d.h. Raspi kann NUR von SD-Card booten) 05/2013Thomas Koch
  • 4. Hardware: Der Raspberry Pi 05/2013Thomas Koch  Das Board  GPIO (General Purpose Input/Output)  CSI (Camera Serial Interface)  DVI-Out  OS  Raspbian (Debian)  Arch Linux  RISC OS
  • 5. Anwendungsmöglichkeiten  Network Device  Print- und Webserver, VPN-Server, DHCP-Server etc.  Cloud für eigenes Netzwerk  Raspberry Pi als Mediacenter  XBMC basierende Distributionen wie OpenELEC, Raspbmc  Oder auch als AirPlay Empfänger  Remote Control  Steuereinheit für eigene Roboter oder Luftfahrzeuge  Home Automation  Alarm Anlage  Kiosk-Systeme  eingebauterWeb-Browser "midori" bietetVollbildmodus $ midori -e Fullscreen -a <URL> http://lifehacker.com/5978871/ten-more-awesome-projects-for-your-raspberry-pi
  • 6. Anwendungsbeispiele 05/2013Thomas Koch  Jumbo Digital Picture Frame http://raspberrypihobbyist.blogspot.de/2013/02/jumbo-digital-picture-frame.html
  • 7. Anwendungsbeispiele 05/2013Thomas Koch  Roboter-Steuerung per Spracheingabe! http://www.youtube.com/watch?v=_U_v9tRD68k
  • 8. Anwendungsbeispiele 05/2013Thomas Koch  MAME Arcade Table  http://www.instructables.com/id/Coffee-Table-Pi
  • 9. Mini Tutorial 05/2013Thomas Koch  Erste Schritte  Raspian auf SD-Karte „installieren“ und einstecken  Einstecken (kein An/Aus-Schalter!)  Login: user: pi / pwd: raspberry (Tipp: passwd ,-)  Desktop-GUI: startx  Debian basics  $ apt-get update  $ apt-get upgrade  $ apt-get install <pkg>  $ apt-get autoclean
  • 10. Mini Tutorial II 05/2013Thomas Koch  Konfiguration:  $ raspi-config  ‘enable ssh’  ‘change_pass ‘  change system password (for the user 'pi') http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration/overview  nützliche Debian Pakete  für GPIO: "WiringPi" https://projects.drogon.net/raspberry-pi/wiringpi/  $ sudo apt-get install git-core  $ git clone git://git.drogon.net/wiringPi
  • 11. GPIO Basics 05/2013Thomas Koch  GPIO perWiringPI steuern  Ports per WiringPI ansteuern  command-line utility gpio  can be used to program and setup the GPIO pins  pi@raspi ~ $ gpio readall  Python-Bindings  Bindings für GPIO-Projekt WiringPi auf github: https://github.com/WiringPi/WiringPi-Python +----------+------+--------+------+-------+ | wiringPi | GPIO | Name | Mode | Value | +----------+------+--------+------+-------+ | 0 | 17 | GPIO 0 | IN | Low | | 1 | 18 | GPIO 1 | IN | Low | | 2 | 27 | GPIO 2 | OUT | Low | | 3 | 22 | GPIO 3 | IN | Low | | 4 | 23 | GPIO 4 | IN | Low | | 5 | 24 | GPIO 5 | IN | Low | | 6 | 25 | GPIO 6 | IN | Low | | 7 | 4 | GPIO 7 | IN | Low | | 8 | 2 | SDA | ALT0 | High | | 9 | 3 | SCL | ALT0 | High | | 10 | 8 | CE0 | IN | Low | | 11 | 7 | CE1 | IN | Low | | 12 | 10 | MOSI | IN | Low | | 13 | 9 | MISO | IN | Low | | 14 | 11 | SCLK | IN | Low | | 15 | 14 | TxD | ALT0 | High | | 16 | 15 | RxD | ALT0 | High | | 17 | 28 | GPIO 8 | IN | Low | | 18 | 29 | GPIO 9 | IN | Low | | 19 | 30 | GPIO10 | IN | Low | | 20 | 31 | GPIO11 | IN | Low | +----------+------+--------+------+-------+ $ gpio mode 0 out $ gpio write 0 1 $ gpio write 0 0
  • 12. Python auf dem Raspberry PI 05/2013Thomas Koch  Python included  Raspi kommt mit Python 2.7 und 3.2  und pygame http://www.pygame.org/  GPIO mit Python  simple GPIO PythonWrapper: RPi.GPIO  A module to control Raspberry Pi GPIO channels  includes a C extension  any script using RPi.GPIO must run with root privileges!  https://pypi.python.org/pypi/RPi.GPIO
  • 14. Beispiel: WiringPi 05/2013Thomas Koch  Serielle Schnittstellte  GPIO bietet pins für 'transmit' signal (TxD) and 'receive' signal (RxD)  Achtung: Raspberry Pi verwendet 0 – 3.3V level (RS-232: +/-12V)  serialOpen: Requires device/baud and returns an ID  https://projects.drogon.net/raspberry-pi/wiringpi/  http://elinux.org/RPi_Serial_Connection serial = wiringpi.serialOpen('/dev/ttyAMA0',9600) wiringpi.serialPuts(serial,"hello") wiringpi.serialClose(serial) // Pass in ID
  • 15. Beispiel: RPi.GPIO 05/2013Thomas Koch  LED einschalten  http://elinux.org/RPi_Low-level_peripherals#Python  https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/ import RPi.GPIO as GPIO # header pin numbering BCM GPIO 00..nn GPIO.setmode(GPIO.BCM) # Set up the GPIO channels: # one input and one output GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.OUT) input_value = GPIO.input(17) print „pin#17 is“, input_value GPIO.output(18, GPIO.HIGH)
  • 16. Weiterführende Links/ Infos  Websites  Raspberry Foundation  http://www.raspberrypi.org  Adafruit (Tutorials, hardware kits, etc.)  http://learn.adafruit.com  Embedded LinuxWiki http://elinux.org  Online-Magazin: http://www.themagpi.com  Literatur  Raspberry Pi - Einstieg • Optimierung • Projekte Maik Schmitd, dpunkt verlag, http://www.dpunkt.de/raspi  Getting Started with Raspberry Pi http://blog.makezine.com/2012/12/25/ten-raspberry-pi-tips Verlag: o'reilly/makers 05/2013Thomas Koch