home_server_pwm.ino ver1

master
Jason Zhu 2020-10-29 14:39:08 +11:00
parent f12624f87a
commit dba521933e
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
int pwm_fan = 6;
void setup() {
//Declaring LED pin as output
pinMode(pwm_fan, OUTPUT);
}
void loop() {
//Fading the LED
for(int i=0; i<255; i++){
analogWrite(pwm_fan, i);
delay(5);
}
for(int i=255; i>0; i--){
analogWrite(pwm_fan, i);
delay(5);
}
}