+ All Categories
Home > Education > Introduzione a RaspBerry PI

Introduzione a RaspBerry PI

Date post: 13-May-2015
Category:
Upload: paolo-aliverti
View: 2,425 times
Download: 3 times
Share this document with a friend
Description:
Presentazione introduttiva al RaspBerry PI
97
Raspberry Pi Paolo Aliverti
Transcript
Page 1: Introduzione a RaspBerry PI

Raspberry Pi

Paolo Aliverti

Page 2: Introduzione a RaspBerry PI

- Panoramica- Sistema Operativo- Hardware- Come lo programmo- Physical Computing & Iot

Page 3: Introduzione a RaspBerry PI

Non è...

Page 4: Introduzione a RaspBerry PI

Non è...

Page 5: Introduzione a RaspBerry PI

Cos'è?

Page 6: Introduzione a RaspBerry PI

Cos'è?

Page 7: Introduzione a RaspBerry PI

Perchè?

Page 8: Introduzione a RaspBerry PI

Perchè?

Page 9: Introduzione a RaspBerry PI

Oggi abbiamo questi...

Page 10: Introduzione a RaspBerry PI

Cosa abbiamo perso?

Page 11: Introduzione a RaspBerry PI
Page 12: Introduzione a RaspBerry PI

Era l'anno 2006...

Page 13: Introduzione a RaspBerry PI

Eben Upton

Rob Mullins, Jack Lang and Alan MycroftUniversità di Cambridge

Page 14: Introduzione a RaspBerry PI

Nasce per loro...

Page 15: Introduzione a RaspBerry PI

Poi lo scopre lei...

Page 16: Introduzione a RaspBerry PI

Che lo dice a lui...

Page 17: Introduzione a RaspBerry PI

Che lo dice a loro!

Page 18: Introduzione a RaspBerry PI
Page 19: Introduzione a RaspBerry PI
Page 20: Introduzione a RaspBerry PI

1.000.000 unità12 mesi

Page 21: Introduzione a RaspBerry PI

Raspberry Pi

1. Panoramica

Page 22: Introduzione a RaspBerry PI
Page 23: Introduzione a RaspBerry PI

BroadCom700Mhz256 o 512 Mb

Page 24: Introduzione a RaspBerry PI

Advanced RISC

Machine

Page 25: Introduzione a RaspBerry PI

1. Alimentazione700mA

Page 26: Introduzione a RaspBerry PI

2. SDclasse 4 4Mb/s

Page 27: Introduzione a RaspBerry PI

3. USB500mA MAX

Page 28: Introduzione a RaspBerry PI

4. HDMI14 risoluzioni

Page 29: Introduzione a RaspBerry PI

5. VideoPAL/NTSC

Page 30: Introduzione a RaspBerry PI

6. Audio AnalogicoHi Z

Page 31: Introduzione a RaspBerry PI

7. Ethernet

Page 32: Introduzione a RaspBerry PI

8. GPIOGeneral Purpose Input & Output3.3V

Page 33: Introduzione a RaspBerry PI

9. LED

Page 34: Introduzione a RaspBerry PI

10. DSIDisplay Serial Interface

Page 35: Introduzione a RaspBerry PI

11. CSICamera Serial Interface

Page 36: Introduzione a RaspBerry PI

Raspberry Pi

1. Sistema operativo

Page 37: Introduzione a RaspBerry PI

Raspbian

Page 38: Introduzione a RaspBerry PI

AlternativeSoft-float Raspbian wheezy – usa la più lenta soft-float ABI. Pensata per essere usata con sw tipo la JVM di Oracle che non supporta la hard-float della raspbian ufficiale

Arch Linux ARM – basata su Arch Linux che offre semplicità e contollo totale. Richiede una certa conoscenza di linux e un po' di esperienza. Si avvia in 10 secondi

RISC OS – è un sistema operativo sviluppato dalla ACORN. Nato nel 1987, di proprietà della Castle Technology e mantenuto dalla RISC OS Open. La versione è stata liberamente messa a disposizione degli utenti del raspberry.

Android 4http://androidpi.wikia.com/

Page 39: Introduzione a RaspBerry PI

Copia del file iso sulla SD

Page 40: Introduzione a RaspBerry PI

Copia del file iso sulla SD

dd bs=1m if=wheezy-raspbian.img of=/dev/rdisk3

Page 41: Introduzione a RaspBerry PI
Page 42: Introduzione a RaspBerry PI

Setup

Page 43: Introduzione a RaspBerry PI

E' linux!

Page 44: Introduzione a RaspBerry PI

startx

Page 45: Introduzione a RaspBerry PI

LXDE

Page 46: Introduzione a RaspBerry PI
Page 47: Introduzione a RaspBerry PI

WIFI

Page 48: Introduzione a RaspBerry PI

Putty e VNC

Page 49: Introduzione a RaspBerry PI

sudo apt-get install tightvncserver

Page 50: Introduzione a RaspBerry PI

synaptic

Page 51: Introduzione a RaspBerry PI

Raspberry Pi

1. Hardware

Page 52: Introduzione a RaspBerry PI

3.3V

Page 53: Introduzione a RaspBerry PI
Page 54: Introduzione a RaspBerry PI

Scripting

/sys/class/gpio

Page 55: Introduzione a RaspBerry PI

Scripting

echo 25 > export

Page 56: Introduzione a RaspBerry PI
Page 57: Introduzione a RaspBerry PI

Scripting

cd gpio25

Page 58: Introduzione a RaspBerry PI
Page 59: Introduzione a RaspBerry PI

Scripting

echo out > direction

Page 60: Introduzione a RaspBerry PI

Scripting

echo 1 > valueecho 0 > value

Page 61: Introduzione a RaspBerry PI
Page 62: Introduzione a RaspBerry PI

Scripting

echo 23 > export

Page 63: Introduzione a RaspBerry PI

Scripting

echo in > direction

Page 64: Introduzione a RaspBerry PI

Scripting

cat value

Page 65: Introduzione a RaspBerry PI
Page 66: Introduzione a RaspBerry PI
Page 67: Introduzione a RaspBerry PI
Page 68: Introduzione a RaspBerry PI

import RPi.GPIO as GPIOimport time

Page 69: Introduzione a RaspBerry PI

GPIO.setup(3, GPIO.OUT)

GPIO.setup(3, GPIO.IN)

Page 70: Introduzione a RaspBerry PI

GPIO.output(3, GPIO.HIGH)

GPIO.output(3, GPIO.LOW)

Page 71: Introduzione a RaspBerry PI

GPIO.input(24)

Page 72: Introduzione a RaspBerry PI

time.sleep(.1)

Page 73: Introduzione a RaspBerry PI

Hello World!

# Hello World

import RPi.GPIO as GPIOimport time

#BCM per le label; BOARD per la piedinatura fisicaGPIO.setmode(GPIO.BCM)

GPIO.setup(3, GPIO.OUT)

while True:GPIO.output(3, GPIO.HIGH)time.sleep(1)GPIO.output(3, GPIO.LOW)time.sleep(.5)

Page 74: Introduzione a RaspBerry PI
Page 75: Introduzione a RaspBerry PI

Raspberry Pi

1. WebCam & Internet

Page 76: Introduzione a RaspBerry PI
Page 77: Introduzione a RaspBerry PI
Page 78: Introduzione a RaspBerry PI
Page 79: Introduzione a RaspBerry PI
Page 80: Introduzione a RaspBerry PI
Page 81: Introduzione a RaspBerry PI

Physical Computing

building interactive physical systems by the use of software and hardware that can sense and respond to the analog world

Page 82: Introduzione a RaspBerry PI
Page 83: Introduzione a RaspBerry PI
Page 84: Introduzione a RaspBerry PI

Tangible User Interface

Page 85: Introduzione a RaspBerry PI

Internet?

Page 86: Introduzione a RaspBerry PI

import urllibimport urllib2

service = urllib2.urlopen("http://www.google.it/")webpage = service.read()print(webpage)

Page 87: Introduzione a RaspBerry PI
Page 88: Introduzione a RaspBerry PI
Page 89: Introduzione a RaspBerry PI

void setup() { Serial.begin(9600); pinMode(13, OUTPUT);}

void loop() { int n = Serial.read(); if ((char)n == 'a') { digitalWrite(13, HIGH); } if ((char)n == 's') { digitalWrite(13, LOW); }}

Sketch Arduino

Page 90: Introduzione a RaspBerry PI

import serial

port = "/dev/ttyACM0"

arduino = serial.Serial(port, 9600)

arduino.flushInput()

while True:

str = raw_input(">:")

if (str == "q"):

break

print str

arduino.write(str)

Python per RBPi

Page 91: Introduzione a RaspBerry PI
Page 92: Introduzione a RaspBerry PI
Page 93: Introduzione a RaspBerry PI
Page 94: Introduzione a RaspBerry PI
Page 95: Introduzione a RaspBerry PI
Page 96: Introduzione a RaspBerry PI

A ottobre...

Page 97: Introduzione a RaspBerry PI

Raspberry Pi

Paolo Aliverti@zeppelinmaker


Recommended