PWM Library

Hello. I am planning a project which requires more than six PWM pins. I tried installing the PWM library from Github. but got this message;
The library "Arduino PWM Frequency Library v_05" cannot be used.
Library names must contain only basic letters and numbers.
(ASCII only and no spaces, and it cannot start with a number)
I tried renaming the library with no spaces and got this message;
Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P"
Specified folder/zip file does not contain a valid library.

Does anyone know where I could find another PWM library or what I'm doing wrong?

I don't think the PWM Frequency Library will get you more PWM outputs. It will let you control the frequency on, probably, two of the 6 PWM pins.

How many more than 6 PWM pins do you need? The Arduino MEGA has 15 PWM pins.

You can add an Adafruit PWM shield (Adafruit 16-Channel 12-bit PWM/Servo Shield - I2C interface : ID 1411 : $17.50 : Adafruit Industries, Unique & fun DIY electronics and kits) to get 16 PWM pins with 12-bit (4096-level) PWM rather than the native Arduino UNO 256-level PWM.

Thanks, John.
My idea requires 9 or 10 PWM pins. The MEGA would not fit in the space I have. I may try to get the Uno and Uno shield you mentioned to fit but I think I need to change my design.

There is the Mega Pro. Smaller than an Uno.

I PWM frequency is not very high it's possible to do a software PWM on each output pin.

Polliwog:
Hello. I am planning a project which requires more than six PWM pins. I tried installing the PWM library from Github. but got this message;

Could you provide more details about your setup and requirements for PWM?

Thanks for your help and I karma,d you. Pgm not complete but my idea needed 9 PWM LEDs. faded at different times I'll have to come up with another idea

alesam:
I PWM frequency is not very high

True: 490 or 977 Hz.

alesam:
it's possible to do a software PWM on each output pin.

But keep in mind that interrupts may cause timing problems!

You can use an addressable LEDs like Amazon.com

Only one pin is required to independently drive all of them

Erik_Baas:
True: 490 or 977 Hz.

But keep in mind that interrupts may cause timing problems!

  • 490 or 977 Hz. are default values but some application required higher frequency
  • In many cases you can disable all other interrupts
  • For LED brightness control intermittent timing problems are not important.

You can try one of these examples to see if OK for your use-case

  1. FakeAnalogWrite
  2. FakeAnalogWrite

They are written to simulate PWM by using TimerInterrupt. You can

  1. modify the ISR frequency to meet your purpose.
  2. re-calibrate and update the mappingTable if need higher accuracy