Home Code Arduino fan module pwm example

Arduino fan module pwm example

by shedboy71

Previously we showed an example of the fan module here http://www.arduinolearning.com/learning/basics/arduino-and-l9110-fan-module-example.php . This used digital I/O but of course you can send an analog value using a pin that supports PWM.

I found out if the number was under 75 the fan would not run at all. So that's what I would suggest as a minimum value

Code

 

[codesyntax lang=”cpp”]

#define INA 9
#define INB 5

byte speed = 75; // Under 75 failed to work in my tests
int sleep = 1000;

void setup()
{ 
pinMode(INA, OUTPUT);
pinMode(INB, OUTPUT);
}

void loop()
{
analogWrite(INA, speed);
analogWrite(INB, 0);

}

[/codesyntax]

 

Share

You may also like