Introuction To Raspberry Pi: BY: Shashank Karthik D Joshi
Introuction To Raspberry Pi: BY: Shashank Karthik D Joshi
Introuction To Raspberry Pi: BY: Shashank Karthik D Joshi
INTROUCTION TO
RASPBERRY PI
What is Raspberry Pi ?
Credit card size single board computer or a
Programmable PC
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
try:
while True:
GPIO.output(12, GPIO.HIGH)
time.sleep(1)
GPIO.output(12, GPIO.LOW)
time.sleep(1)
finally:
GPIO.cleanup()
Changing the brightness of the LED
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
p = GPIO.PWM(12, 50) # channel=12 frequency=50Hz
p.start(0)
try:
while True:
for dc in range(0, 101, 5):
p.ChangeDutyCycle(dc)
time.sleep(0.1)
for dc in range(100, -1, -5):
p.ChangeDutyCycle(dc)
time.sleep(0.1)
finally:
p.stop()
GPIO.cleanup()
Protocols Used:
I2C
SPI
Serial
ADVANTAGES
It is very easy to connect to the internet
Its a Mini Computer which just cost Rs.2,350/-;You can connect a Monitor, Keyboard and
Mouse and use it as a normal computer.