Last active
April 12, 2019 09:46
-
-
Save idriszmy/548aff22fd738cf1b48d4fb2e60608eb to your computer and use it in GitHub Desktop.
Mengawal pin keluaran pada Maker UNO yang bersambung dengan LED.
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: Mengawal pin 9 pada Maker UNO seterusnya | |
membuat kelipan LED L9. | |
Penulis: Idris Zainal Abidin | |
Blog: https://idrisz.my | |
Kemaskini: 15 Mac 2019 | |
*/ | |
void setup() | |
{ | |
pinMode(9, OUTPUT); // Tetapkan pin 9 sebagai pin keluaran | |
} | |
void loop() | |
{ | |
digitalWrite(9, HIGH); // Menghantar isyarat HIGH (voltan 5V) | |
// pada pin 9 seterusnya menyalakan LED | |
delay(200); // Tunggu 200 mili saat (atau 0.2 saat) | |
digitalWrite(9, LOW); // Menghantar isyarat LOW (voltan 0V) | |
// pada pin 9 seterusnya memadamkan LED | |
delay(1000); // Tunggu 1000 mili saat (atau 1 saat) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment