I'm very new to Arduino and I'm trying to figure out proper usage for analogWrite(). I just bought an Itsy Bitsy 32u4 and I'm trying to write some very basic test code that I'll use to drive a tri-cree LED at some point, but right now, I'm just trying to get a single diode to work. The code I currently have doesn't seem to change the value of the pin - it stays fixed at around 150 when I view it in the serial monitor. When I power the board externally, the value drops to around 0. Not really sure what's going on so any help would be appreciated. Thanks!
Yep it does! That's where the image I attached is from originally. I'm attempting to explain that that's where my very little knowledge is coming from and it's not working. Any ideas as to what I'm doing wrong? I'm using pin 13 - any reason that doesn't make sense in this context?
Okay cool. Thanks! So if I wanted three PWM pins for red, green, and blue, would it make sense to use 13, 11, and 7? Most of the PWM pins look like they're hooked up to some other function like interrupts, clocks, etc. so I'm not 100% sure what's available as just a set of basic PWM pins.
You can just move 12 to 9 or 10. The list of things each pin can do would be separate uses for that pin, not other things happening at the same time. For instance, pin 3 can act as a PWM or interrupt (among other things), but you have to pick one when you set the pinMode. Any of the ones that say PWM output will work for what you are doing. Pin 7 is not a PWM.
You asked what pins drive analogout (pwm) and I showed you the page where it was clearly stated.
If you had that already, then (just guessing mind you) that you didn't read the detail properly.
Looking at the image in reply #6, pin 7 does not provide PWM.
When designing a project, you will have to take into account what you all need. E.g. if you have to use I2C for a sensor or I2C display, you can't use pin 3 for PWM because it will be used for SCL (one of the two I2C signals).