SOFT PULSE WIDTH MODULATION

On arduino there are some pins PWM. Other pins that not PWM pin we can used as PWM by Soft Pulse Width Modulation, with this way we can increase number of PWM pins.

soft pwm

The code can be downloaded at :

https://github.com/triantara/ARDUINO-TRIANTARA/blob/main/Soft%20PWM%20modulation.zip

#include <SoftPWM.h>

void setup()
{
SoftPWMBegin();

SoftPWMSet(7, 0);

SoftPWMSetFadeTime(7, 1000, 1000);
}

void loop()
{
SoftPWMSet(7, 255);
delay(1000);
SoftPWMSet(7, 0);
delay(1000);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s