Function only switching one LED?

Rookie question. I am using the following code to toggle LEDs with the DO app and I do not understand why D7 is the only LED light turning on. D0 is getting power when I use Tinker, but something is wrong here.

void ledOn(const char *event, const char *data) {
  digitalWrite(D7, HIGH);
  digitalWrite(D0, HIGH);
}

void ledOff(const char *event, const char *data) {
  digitalWrite(D7, LOW);
  digitalWrite(D0, LOW);
}

void setup() {
  pinMode(D7, OUTPUT);
  Spark.subscribe("light-up", ledOn);
  Spark.subscribe("light-off", ledOff);
}

What about the other pin?

2 Likes

My bad! Like I said, Iā€™m a rookie. Thanks!

Added this:

pinMode(D0, OUTPUT);

and it works great.

1 Like