PWM Rgb LED on the Photon

Ok, I added WHITE color to git, incase its any help with the testing.

I can confirm it’s something to do with the Photon. I have 2 photons and 2 cores and the following test code:

const int rPin = A4;      // the pin that the RED LED is attached to
const int gPin = A5;      // the pin that the GREEN LED is attached to
const int bPin = A6;      // the pin that the BLUE LED is attached to

analogWrite(rPin, 255);
analogWrite(gPin, 255);
analogWrite(bPin, 255);

Works fine on both Cores, blue - pin A6 does not work on either Photon. It’s marked DAC not A6 on the PCB so I’m guessing the pin has been repurposed. A bit annoying when I already have PCBs made up to take a Core, was hoping for a straight swap to Particle :frowning:

I was googling for a solution and ended up here, I’ll update when I find the answer.

So the clue is in the name, A6 that is now called DAC is indeed just a completely different pin. Confusingly you can still use analogWrite() but it gives a true analogue voltage out, not a PWM digital signal. It’s a true DAC.

This is very annoying when all your projects are built around cores. But probably really useful for other projects.

You found it, but also be aware that the same goes for A3.

Ha, I know, before I looked up the pinout/func table I just swapped A6 for A3 (3,4,5, instead of 4,5,6) no joy.

Now I’m running it from D0.1.2 instead and I’m in the process of modifying my boards.