Raspberry Pi Guide Pinout confusion

Just got the Particle Agent running on my Pi 3. Installation went smoothly but then…

  • The Getting Started Examples “Blink an LED” Frizting diagram under the SETUP section shows D0 wired to the resistor and LED. But…
  • In code, D0 actually maps to the green LED next to the red power LED on a RPi 3
  • D7 is what the Data Sheet “Interfaces” PERIPHERALS AND GPIO section and the comments in the “Blink an LED” CODE section say is the little green LED. D7, as the pinout chart in the Data Sheet show, maps to the physical pin number 35. In code D7 does not control the green led on the Pi. It controls pin 35.

Am I bonkers or is that documentation wrong?

I’m using the Adafruit Pi Cobbler on a breadboard.

Here is my set up for “Control LEDs over the 'net”, which is working. In code, D7 turns this LED on and off and D0 turns the green LED on and off. I commented D0 out to verify that it was turning the green LED on and off:

I thought maybe my ribbon cable was turned around, but I don’t believe that is the case:

seems the green LED was “wired” (in software) to D7 to make the tinker-app actually do something easily…

you might have found this either yet:
https://www.raspberrypi.org/forums/viewtopic.php?f=31&t=12530

I’m not sure what the issue is. The documentation you link to is accurate.

This codes makes the green status LED of a Raspberry Pi 3 blink for me.

void setup() {
  pinMode(D7, OUTPUT);
}
void loop() {
  digitalWrite(D7, HIGH);
  delay(1000);
  digitalWrite(D7, LOW);
  delay(1000);
}

With the same T-Cobbler Plus as in your picture, with the same cable orientation and a Raspberry Pi 3, this program makes the pin labeled #4 toggle.

void setup() {
  pinMode(D7, OUTPUT);
}
void loop() {
  digitalWrite(D7, HIGH);
  delay(1000);
  digitalWrite(D7, LOW);
  delay(1000);
}

You’re bonkers! :laughing: :wink:

On my RPi 1 B+, D0 links to GPIO4 (physical pin 7), and D7 links to GPIO19 (physical pin 35) as per the particle datasheet.

When Tinker triggers D0, only the GPIO4 (#7) led comes on. When it triggers D7, both the GPIO19 (#35) and the onboard LED comes on. If I use the example code, and control D7 only, then both GPIO19 (#35) and the onboard led toggle. If I control D0 only, just GPIO4 (#7) toggles. So for me on a RPi 1 B+, everything is working as documented on that front. :wink:

However, it looks like the RPi 3 doesn’t link GPIO19 (#35) to the status LED by default, so the particle firmware must be getting to it some other way. Maybe check you haven’t changed any parameters in /boot/config.txt which is causing this?

1 Like