This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Fungsi kod: Memaparkan status butang tekan dan mengawal LED | |
pada pin 3 hingga 7 daripada arahan di Serial | |
Monitor melalui komunikasi siri. | |
Penulis: Idris Zainal Abidin | |
Blog: https://idrisz.my | |
Kemaskini: 10 Mei 2019 | |
*/ | |
#define BUTTON 2 // Butang tekan bersambung pada pin 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membuat kelipan LED pada pin GPIO17. | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 10 Mei 2019 | |
# | |
from gpiozero import LED # Import fungsi LED dari pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membuat kelipan LED pada pin GPIO17 dan GPIO18. | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 15 Mei 2019 | |
# | |
from gpiozero import LED # Import fungsi LED dari pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membuat kelipan LED pada pin GPIO17. | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 15 Mei 2019 | |
# | |
from gpiozero import LED # Import fungsi LED dari pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membaca status butang tekan di Maker pHAT | |
# dan mengawal LED | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 16 Mei 2019 | |
# | |
from gpiozero import LED, Button # Import fungsi LED dan Button | |
# dari pustaka gpiozero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membaca status gabungan butang tekan di | |
# Maker pHAT dan mengawal LED | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 16 Mei 2019 | |
# | |
from gpiozero import LED, Button # Import fungsi LED dan Button | |
# dari pustaka gpiozero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Membaca status butang tekan di Maker pHAT | |
# dan mengawal LED | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 16 Mei 2019 | |
# | |
from gpiozero import LED, Button # Import fungsi LED dan Button | |
# dari pustaka gpiozero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Menghasilkan bunyi daripada pembaz (Contoh 1). | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 20 Mei 2019 | |
# | |
from gpiozero import LED, Buzzer # Import fungsi LED dan Buzzer | |
# daripada pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Menghasilkan bunyi daripada pembaz (Contoh 2). | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 20 Mei 2019 | |
# | |
from gpiozero import Button, Buzzer # Import fungsi Button dan Buzzer | |
# daripada pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fungsi kod: Menghasilkan bunyi daripada pembaz (Contoh 3). | |
# Penulis: Idris Zainal Abidin | |
# Blog: https://idrisz.my | |
# Kemaskini: 20 Mei 2019 | |
# | |
from gpiozero import LED, Button, Buzzer # Import fungsi LED, Button dan Buzzer | |
# daripada pustaka gpiozero | |
from time import sleep # Import fungsi sleep dari pustaka time |