Raspberry Pi Workshop Inixindo
Raspberry Pi Workshop Inixindo
Software
2015
Raspberry Pi Workshop
Oleh: Tulus Budyarso
Agenda
Features Model B
Raspberry Pi Component
Raspberry Pi Models
Installation of Raspbian
OS
Installation tools
For Windows
SDFormatter.exe
Win32DiskImager.exe
For Linux
$$dd
Procedure in Windows
Download Raspbian OS from:
http://downloads.raspberrypi.org/raspbian_latest
Procedure in Linux
Download Raspbian OS from:
http://downloads.raspberrypi.org/raspbian_latest
Example
sudo dd bs=4m if=2013-02-09-wheezy-raspbian.img of=/dev/sdb
deb http://kambing.ui.ac.id/raspbian/raspbian
wheezy main contrib non-free
deb-src http://kambing.ui.ac.id/raspbian/raspbian
wheezy main contrib non-free
smb://raspberrypi/
Or :
smb://$SMB_HOST_IP/
GPIO Raspberry Pi
Basic Output
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(22,GPIO.OUT)
try:
while 1:
GPIO.output(17,GPIO.HIGH)
GPIO.output(21,GPIO.HIGH)
GPIO.output(22,GPIO.HIGH)
time.sleep(1)
GPIO.output(17,GPIO.LOW)
GPIO.output(21,GPIO.LOW)
GPIO.output(22,GPIO.LOW)
time.sleep(1)
finally:
GPIO.cleanup()
Basic Input
#!/usr/bin/python
import os
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(24, GPIO.IN)
print("------------------")
print(" Button + GPIO ")
print("------------------")
print GPIO.input(24)
while True:
if ( GPIO.input(24) == False
):
print("Button Pressed")
os.system('date')
print GPIO.input(10)
time.sleep(5)
else:
os.system('clear')
print ("Waiting for you
to press a button")
time.sleep(1)
#!/usr/bin/python
import os
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(10, GPIO.IN)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(22,GPIO.OUT)
print("------------------")
print(" Button + GPIO ")
print("------------------")
print GPIO.input(10)
while True:
if ( GPIO.input(10) == False
):
GPIO.output(17,GPIO.HIGH)
GPIO.output(21,GPIO.HIGH)
GPIO.output(22,GPIO.HIGH
else:
GPIO.output(17,GPIO.LOW)
GPIO.output(21,GPIO.LOW)
GPIO.output(22,GPIO.LOW
time.sleep(1)
Thank You