Hey guys, so I’ve been working on a small project that is basically finished with the exception of me being unable to get PWM on several of the pins of an arduino mini pro/arduino uno (atmega328 chip). The idea behind the project is to read RPM from the can bus and apply a specific voltage to the pedal wires. It works great until I started adding stuff and running out of pins to use.
My understanding is that if you use millis() or related functions, or timer0 at all, you will not be able to get PWM on pins 5 and 6. Originally I had been using these pins for PEDAL_MAIN and PEDAL_ALT and neither worked, so I changed the pins to 3 and 9. Unfortunately, while pin 9 is now working fine, pin 3 still won’t work and I’m out of pins to use. I’m unaware of any reasons why PWM on pin 3 would not be working, the pin isn’t being used by anything else as far as I am aware.
We’ve tried changing all kinds of stuff and haven’t made any progress in the last few days, so hopefully someone here knows what’s going on.
TLDR: I have attached the code in case anyone can figure out what is going wrong here, currently I cannot use pins 3, 5, or 6 for PWM and I need one of them to work. If anyone knows what has gone wrong any information would be appreciated:
RPM (1).txt (7.7 KB)