Hi everyone.
I'm currently adding Arduino and nRF24l01 modules to a forklift model that I have. It uses one motor for driving, and a second motor for lifting/lowering the pallet fork. I also have a steering servo.
But there is one minor problem to this build, which is that the Arduino Pro Mini (as many other Arduino models) only have 6 PWM pins. I would need 3 PWM pins for the NRF module, 3 for the motor driver (remember, two motors) and 1 PWM pin for the steering servo, which makes a total of 7 PWM pins. Thats where my problem starts... I need one extra PWM pin, or do I? I'm using a TB6612FNG motor driver, which defines the pins like this:
#define AIN1 2
#define BIN1 7
#define AIN2 4
#define BIN2 8
#define PWMA 5
#define PWMB 6
#define STBY 9
The STBY pin is described like this on sparkfuns page about the motor driver: Allows the H-bridges to work when high (has a pulldown resistor so it must actively pulled high), and I have just assumed that this needs to be a PWM pin.
So first question, am I wrong? Maybe I could use another pin for the STBY and then it would work perfectly.
Second thought: I also want to add lights, and maybe a horn to the model, so I've been thinking of adding a second Arduino anyways (because I'd need more pins). I have looked up the I2C protocol and the Software serial library, but the only problem is that I need to send a whole bunch of data values, not just one at a time. I would guess that there is a way to send multiple data values (or an array), but I have not yet figured it out. Could anyone please tell me how this can, and should be done?
Thanks in advance.
Marcus