Last active
August 29, 2015 14:04
-
-
Save keanhm2/a01fe00156f9793ad826 to your computer and use it in GitHub Desktop.
Arduino 2 - PWM Kontrollü LED
This file contains hidden or 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
// http://keanhm2engineering.blogspot.com.tr/2014/07/arduino-ile-pwm-kontrollu-led.html | |
// http://www.youtube.com/watch?v=WrCydy_aK-Q | |
int pwmLED1 = 11; | |
int pwmLED2 = 10; | |
int pwmLED3 = 9; | |
int pwmLED4 = 6; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
while(true) | |
{ | |
for(int i=0; i<=255; ++i) | |
{ | |
analogWrite(pwmLED1, i); | |
analogWrite(pwmLED2, i); | |
analogWrite(pwmLED3, i); | |
analogWrite(pwmLED4, i); | |
Serial.print("i degeri="); | |
Serial.println(i); | |
} | |
for(int j=255; j>=0; --j) | |
{ | |
analogWrite(pwmLED1, j); | |
analogWrite(pwmLED2, j); | |
analogWrite(pwmLED3, j); | |
analogWrite(pwmLED4, j); | |
Serial.print("j degeri="); | |
Serial.println(j); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment