Download - Raspberry Pi + Python
![Page 1: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/1.jpg)
Raspberry Pi + Python
Daker Fernandes Pinheiro (dakerfp)
Novembro/2012, Python Brasil [8] - Rio de Janeiro / RJ
![Page 2: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/2.jpg)
$ whois dakerfp
� Daker Fernandes Pinheiro
� Ciência de Computação pela UFPE - Recife/Brasil
� 2010 - Instituto Nokia de Tecnologia
� Qt, KDE, ...
![Page 3: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/3.jpg)
![Page 4: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/4.jpg)
O que é?
The Raspberry Pi is a credit-card sized computer thatplugs into your TV and a keyboard. It's a capable littlePC which can be used for many of the things that yourdesktop PC does, like spreadsheets, word-processing andgames. It also plays high-de�nition video. We want tosee it being used by kids all over the world to learnprogramming.
� Barato!
� http://raspberrypi.org/
![Page 5: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/5.jpg)
O que posso fazer?
![Page 6: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/6.jpg)
![Page 7: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/7.jpg)
Raspberry Pi vs Arduino
Arduino� Sentir e Controlar o mundo físico� + Sinais Digitais� + Conversor ADC onboard� + Shields
![Page 8: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/8.jpg)
Raspberry Pi + Arduino
� Bridge� Arduino to RPi shields� Gertboard
![Page 9: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/9.jpg)
Como obter?
� Modelo A (256MB) - US$25
� Modelo B (512MB) - US$30
� Farnell: http://www.farnell.com/
� RS Components: http://uk.rs-
online.com/web/generalDisplay.html?id=raspberrypi
� + Fonte Micro USB
� + Cartão SD
![Page 10: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/10.jpg)
Valeu Brasil!
� >R$150,00
� Câmbio
� Frete Internacional
� Imposto Alfendegário
� ICMS
� INFRAERO
� Taxas Administrativas
� ...
![Page 11: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/11.jpg)
Setup
� Download de imagemhttp://www.raspberrypi.org/downloads
� Raspbian� ArchLinux� RISC OS
� $ dd if=imagem.img of=/dev/cartao-sd ||Win32DiskImager
� Encaixe o cartão SD na RPi
� Encaixe a fonte mini USB na força || 4 pilhas
� Redimensione o espaço utilizado
� Have fun!
![Page 12: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/12.jpg)
Util
� user: pi password: raspberry
� startx
� shutdown -h 0
� dhclient
![Page 13: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/13.jpg)
Python on the Pi
Por quê?
� Didático
� Fácil
� Compilação
� Cross Compilação (arm)
� Divertido
Raspbian
� IDE inclusa
� Exemplos
� Divertido
![Page 14: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/14.jpg)
Bibliotecas Grá�cas
� PySide
� PyQt
� PyGTK
� PyGame
� Kivy
� pycairo
� pye�
� PySDL
� ...
![Page 15: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/15.jpg)
Aceleração grá�ca
� OpenGL vs OpenGL ES
� OpenGL ES 2: pogles
� OpenMAX: gst-openmax
� Conheça sua API grá�ca
� X.org free: RPi_Vid_Core:https://bitbucket.org/bryancole/rpi_vid_core/wiki/Home
� WIP: Wayland
![Page 16: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/16.jpg)
IO
� Seu framework favorito :-)� X.org free:
� evdev: pyglet� GPIO: RPi.GPIO
![Page 17: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/17.jpg)
IO
� High: 3.3V Low: 0V� Não é 5V tolerant� Não há proteção contra super-voltagem
![Page 18: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/18.jpg)
Dicas
� Evite threads, event loops resolvem
� Python é bom para prototipar, mas não temperformance con�ável em embarcados
� Use o X.org apenas se necessário
� Pense OpenGL ES 2
� Minimize uso de CPU
� Delegue mais funções para APIs implementadas emC
� Faça pro�le antes de otimizar
� Otimize algoritmos antes de escovar bits
![Page 19: Raspberry Pi + Python](https://reader034.vdocuments.net/reader034/viewer/2022052215/5554aee1b4c90502618b54a1/html5/thumbnails/19.jpg)
Duvidas?
http://codecereal.blogspot.comhttp://raspberrypi.org
http://www.elinux.org/R-Pi_Hub@dakerfp
freenode dakerfp
Daker Fernandes Pinheiro (dakerfp)[email protected]://www.anselmolsm.org