Hello, i am a new user of the Arduino mega 2560 r3. Standard on this board you have 8 digital pin (PWM) availble. But for my new project a need at least 18 digital pin (PWM). I want to connect the mebrance switch module, 2x L9110 H-bridge motordriver and 6x micro switch.
Can someone explain or advise me how to create more digital pins with PWM?
Or how using the other (normal) digital pins?
I don't know what other possiblities there are. I have a starterskit and practice with some examples and I see everytime they using the PWM pins.
I don't know how to use other ports, so please advise me in this
I'm a real beginner so where can I find a good tutorial that gives a simple explaination of all the different types of pins on my board and how I can use them in a project?
The Mega R3 has 70 digital pins.
Switches usually use a digital pin with pinMode (pinX, INPUT_PULLUP); to set them as inputs, and do not need PWM.
The membrane switch module does not need PWM pins.
The L9110 only needs 2 PWM inputs per chip. A two-chip board would only use 4 PWM pins. The other control signals used are not PWM.
The Arduino Mega has 15 PWM pins.
But we don't understand why you need 18 PWM pins. What do you need them for ?
Can you make a drawing of how everything is connected and make a photo of that ?
We have the impression that you think you need PWM, but you don't.
If you really need them, there are libraries that can create a PWM signal on normal digital pins. Using that library has a lot of consequences, and you probably don't need so many PWM signals in the first place.
For example this library: https://github.com/Palatis/arduino-softpwm.
But that is a highly optimized library that takes over the Arduino board. You will get into so much trouble if you use that.
Sorry for the very late reaction. I had park my project for some time because a was busy for work.
Now a have more time too work on my project and I draw a scheme of it. Can you help me by telling with Arduino (digital) pins I can use for this.
It's my first big project with the Arduino board, so this is all new for me.
Thanks in advance for your support.
For 3 motors with those L9110 modules, you need 6 PWM pins.
Reading this topic once more, reply #7 by CrossRoads already gave the answer.
Use the Arduino Keypad library for the membrane keypad, it needs 8 normal digital pins.
This page might not be up to date, but it does explain the library: https://playground.arduino.cc/Code/Keypad/