Code not working after flashing Photon

I am trying to make the move to Workbench from the IDE and after many struggles I have made significant progress. I think I have successfully complied and flashed the code. When nothing happened (i.e. no LEDs lite up) I went back to the Web IDE and successfully compiled and flashed the same code on the Web.

Nothing happened with either attempt. I guess the good news is that my problem is NOT with workbench.
I thought perhaps the OS version was wrong, but that seems to be fine - the latest 1.4.4 per the Web IDE.

The board is flashing green and seems to go thru all the proper led states during the flash.
I have included the simple code below for info, but I don’t think that is the problem. I would expect at a minimum that the internal LED would blink.

Could it be that I somehow damaged the Photon itself. I have another one on the same breadboard running a more complicated program that seems to be working fine. I am reluctant to fool with this one in case I did something bad with the other one that damaged it. I have two more photons with headers that I bought from Particle that should be arriving any day now. When they come I can try substituting hardware.

But in the mean time, can you give me some guidance about how to best checkout my wayward Photon’s health? If I can get past this hurdle, I may have conquered Workbench and can make the switch from the Web IDE.

Thanks
Chris .

int LedPin7=D7;
int greenLed=D6;
// setup() runs once, when the device is first turned on.
void setup() {
  PinMode(LedPin7)=OUTPUT;
  PinMode(greenLed)=OUTPUT;
  Serial.begin(9600);
}

void loop() {
  // The core of your code will likely live here.
  digitalWrite(LedPin7,HIGH);
  digitalWrite(greenLed,HIGH);
  Serial.println("Green is On");

  delay(1000);
  digitalWrite(LedPin7,LOW);
  digitalWrite(greenLed,LOW);
  Serial.println("Green is Off");
  delay(1000);
}

I don’t believe your code can build.
you pinMode() syntax is off

BTW, can you post a video of your dead Photon?

Thanks! What a newbie mistake. I have been focused on Workbench so long I got rusty on basic arduino coding. Once I fixed the pinMode syntax everything worked fine. So I think(hope) I am on my way to being a workbench user.

The only thing I don’t understand is why workbench and the Web IDE seemed to compile the code without complaint. I would have expected Workbench to complain about the syntax. But hey, I am on my way now and will not look back.

Thanks
Chris

As I said, I don't believe they actually did.
Can you try again?

BTW, the topic title should actually provide some hint about your point at hand, just stating your own name is not what the title should be.
How would you title your next topic?

1 Like

I agree. It is hard to believe. Here is the screen shot from the IDE. yes, the = sign is red But the compiler assured me: Great Work.

If it objected I would have fixed the program error.

Thanks for your ongoing support.
Chris

image
image

int LedPin7=D7;
int greenLed=D6;
// setup() runs once, when the device is first turned on.
void setup() {
  PinMode(LedPin7)=OUTPUT;
  PinMode(greenLed)=OUTPUT;
  Serial.begin(9600);
}

void loop() {
  // The core of your code will likely live here.
  digitalWrite(LedPin7,HIGH);
  digitalWrite(greenLed,HIGH);
  Serial.println("Green is On");

  delay(1000);
  digitalWrite(LedPin7,LOW);
  digitalWrite(greenLed,LOW);
  Serial.println("Green is Off");
  delay(1000);
}

That’s an unfortunate combination of two mistakes.

The capital P in PinMode made that not a function call but since PinMode is a type merely created a varible with the name in brackets and then assigning the value to that.

3 Likes