Particle Dev "PIN" was not declared in this scope

I have some very basic code that I am trying to get to work on the Particle Dev local IDE. When I attempt to verify this code, I get two errors, looking like ‘D0’ not declared in this scope.

What could be causing this?

Here is my code, for anyone wondering. The blink LED example gives 8 errors of a similar kind.

int left = D0;
int right = D1;

void setup()
{
  pinMode(left, OUTPUT);
  pinMode(right, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  if (digitalRead(left) == HIGH)
  {
    Serial.println("LEFT");
  }
  if(digitalRead(right) == HIGH)
  {
    Serial.println("RIGHT");
  }
}

Have you included “application.h” header?

1 Like

Also, make sure that your project has its own folder, without any other non-related files in it.

@jaycmiley, you are reading digital inputs that you set as outputs! You may want to change your pinMode() statements. :smile:

1 Like

For whatever reason it worked today, after taking Moors’ suggestion.

Moors7, it wasn’t working as such yesterday but it did today.

Melx, I did not need to, evidently.

Peekay thanks for pointing it out but it was irrelevant to the question at hand.