I continue to play with the new Photon2 module. Today was starting to work through what it takes to migrate my main Boron based code to the Photon2. Some things worked some things didn’t. As I investigate each item I’ll make a post in the community.
Issue 1: The RGB.mirrorTo(rpin,gpin,bpin) does not work for pin A0 or A1 on the P2 as tested on the latest deviceOS 5.3.2 as well as the earliest version that supports P2 5.0.0.
For this test, I’m just using a single LED (that happens to be red) but wired to the Blue pin on a bread board since that’s the one that “breaths” when cloud connected.
Here is the code that works when the LED is on A2: RGB.mirrorTo(A4, A3, A2);
#include "Particle.h"
void setup();
void loop();
const pin_t MY_LED = D7;
SYSTEM_THREAD(ENABLED);
void setup()
{
pinMode(MY_LED, OUTPUT);
// Let's test mirroring the Blue pin to A2
RGB.mirrorTo(A4, A3, A2);
}
void loop()
{
// Basic D7 pin on/off for fun
digitalWrite(MY_LED, HIGH);
delay(1s);
digitalWrite(MY_LED, LOW);
delay(1s);
}
Here is the hardware setup. Notice the external LED wired to A2 matches the RGB LED. I went back to the basics here using a breadboard and it works as it should:
Now let’s try A0. This is the sketch. Notice the only difference is RGB.mirrorTo(A4, A3, A0);
#include "Particle.h"
void setup();
void loop();
const pin_t MY_LED = D7;
SYSTEM_THREAD(ENABLED);
void setup()
{
pinMode(MY_LED, OUTPUT);
// Let's test mirroring the Blue pin to A0
RGB.mirrorTo(A4, A3, A0);
}
void loop()
{
// Basic D7 pin on/off for fun
digitalWrite(MY_LED, HIGH);
delay(1s);
digitalWrite(MY_LED, LOW);
delay(1s);
}
And let’s update the pin used on the breadboard. Here it does not work :
Is the A0 pin working properly otherwise: YES
Just to confirm the output pin is working and I’m not doing anything stupid, I changed the 1 second flashing of D7 to be A0 instead and in that scenario A0 does blink on/off as expected just like D7 did previously. So the A0 pin does work as a general GPIO output, it’s wired up correctly. It just does not work when used as RGB.mirrorTo().
I.e. using the same original sketch I changed this: const pin_t MY_LED = A0;
and it worked properly blinking every second.
Is it device OS version or P2 specific? Let’s see it works on the Boron in deviceOS 5.3.2: YES
This is my first time testing anything in deviceOS 5.3.2. Maybe something broke in deviceOS, lets test the Boron again to make sure. As you can see below it works:
What about earlier versions of device OS and P2? Let’s try Device OS 5.0.0: No still not working with Device OS 5.0.0
Therefore, I conclude it’s something wrong specific to the P2 when using RGB.mirrorTo() pins A0, A1.
Not sure if it’s only A0 and A1 affected or not as I didn’t go through and test all the GPIO pins for this. My carrier board I used for Boron’s previously uses A0 so I am hopeful we can get that working again. I’d hate to have to order new carrier boards just to change to a functional RGB pin.