Created
February 19, 2018 10:07
-
-
Save ikizoglu/c3543e2f3c20993764629c2db992a92d to your computer and use it in GitHub Desktop.
Arduino RGB Led Kullanımı - Karma Renkler
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
// ************************ | |
// ** Kemal İKİZOĞLU ** | |
// ************************ | |
int kirmiziPin= 10; | |
int yesilPin = 8; | |
int maviPin = 9; | |
void setup() { | |
pinMode(kirmiziPin, OUTPUT); | |
pinMode(yesilPin, OUTPUT); | |
pinMode(maviPin, OUTPUT); | |
} | |
void loop() { | |
setColor(255, 255, 255); // Beyaz | |
delay(1000); | |
setColor(170, 0, 255); // Mor | |
delay(1000); | |
setColor(255, 255, 0); // Sarı | |
delay(1000); | |
setColor(0, 255, 255); // Açık Mavi | |
delay(1000); | |
setColor(128, 255, 0); // Açık Yeşil | |
delay(1000); | |
setColor(128, 0, 0); // Maroon | |
delay(1000); | |
setColor(0, 0, 128); // Lila | |
delay(1000); | |
} | |
void setColor(int redValue, int greenValue, int blueValue) { | |
analogWrite(kirmiziPin, redValue); | |
analogWrite(yesilPin, greenValue); | |
analogWrite(maviPin, blueValue); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment