Photon P1 Pin #40 40 => PB0 => SPARE1 => GPIO_Pin_0

Hi @hk101 when you say you are connecting to pin 40, do you mean literally pin 40 on the P1 module?

If so, this is P1S0 so in code would look like this:

int MYLED = P1S0; 

void setup() {
  pinMode(MYLED, OUTPUT);
}

void loop() {
  digitalWrite(MYLED, HIGH);
  delay(5000);
  digitalWrite(MYLED, LOW);
  delay(5000);
}

When connected to the cloud, you should be breathing CYAN.
Flashing OTA will blink MAGENTA.
Connecting to Wi-Fi will blink GREEN.
DFU mode will blink YELLOW.

Maybe you have your RGB led hooked up wrong? A quick test code will help, you should see RED, GREEN, BLUE after it connects to the cloud, then it should go back to breathing CYAN.

void setup() {
  RGB.control(true);
  RGB.color(255,0,0);
  delay(2000);
  RGB.color(0,255,0);
  delay(2000);
  RGB.color(0,0,255);
  delay(2000);
  RGB.control(false);
}

void loop() {
}
3 Likes