jump to navigation

Membuat Flip-Flop melalui GPIO di Rasberry October 2, 2014

Posted by puji in Raspberry, Uncategorized.
trackback

Pin GPIO yang dapat digunakan sebagai output digital sebanyak 17 PIN, yaitu

PIN 3, 5, 7, 11, 13, 15, 19, 21, 23 = 9 Pin
PIN 8, 10, 12, 16, 18, 22, 24, 26 = 8 Pin

Untuk lebih jelasnya perhatikan gambar berikut ini


Flip-Flop melalui GPIO
Berikut kode program flip-flop menggunakan pin 11

import RPi.GPIO as GPIO
 import time
 # blinking function
 def blink(pin):
 GPIO.output(pin,GPIO.HIGH)
 time.sleep(1)
 GPIO.output(pin,GPIO.LOW)
 time.sleep(1)
 return
 # to use Raspberry Pi board pin numbers
 GPIO.setmode(GPIO.BOARD)
 # set up GPIO output channel
 GPIO.setup(11, GPIO.OUT)
 # Blink 50 kali
 for i in range(0,50):
 blink(11)
 GPIO.cleanup()

Referensi
http://www.rpiblog.com/2012/09/using-gpio-of-raspberry-pi-to-blink-led.html

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: