1//Controlling a DC fan with an N-channel MOSFET23voidsetup(){4// put your setup code here, to run once:5pinMode(2,OUTPUT);67}89voidloop(){10// put your main code here, to run repeatedly:11digitalWrite(2,HIGH);12delay(5000);13digitalWrite(2,LOW);14delay(5000);15}
MOSFETcontrol
arduino
1//Controlling a DC fan with an N-channel MOSFET23voidsetup(){4// put your setup code here, to run once:5pinMode(2,OUTPUT);67}89voidloop(){10// put your main code here, to run repeatedly:11digitalWrite(2,HIGH);12delay(5000);13digitalWrite(2,LOW);14delay(5000);15}