Upload Code Issue

Hi there;

I start to use platform io instead of arduino idle. I tried a basic code for test the program. I upload the code to arduino with platfom io. I didn’t get any error message on the terminal screen. I got a message saying installation was succesful. However the code didn’t work on arduino. When I upload the same code with the arduino idle program, the code works, but when I upload it with platform io, the code doesn’t work. I couldn’t find out why. Can you help me about this issue.

Please provide the full platformio.ini, code, and observed behavior in the Arduino IDE and PlatformIO.

#include <Arduino.h>
#define button 6
#define greenLed 10
#define redLed 9
int buttonState=0;
int start=0;

void setup() {
  pinMode(button,INPUT);
  pinMode(greenLed,OUTPUT);
  pinMode(redLed,OUTPUT);
  digitalWrite(greenLed,LOW);
  digitalWrite(redLed,HIGH);
  attachInterrupt(0,Pause,RISING);
}

void loop() {
  buttonState=digitalRead(button);
  if (buttonState==1)
  {
    start++;
  }
  while (start>0)
  {
    digitalWrite(greenLed,HIGH);
    digitalWrite(redLed,LOW);
  }
}

void Pause()
{
  digitalWrite(redLed,HIGH);
  digitalWrite(greenLed,LOW);
  start=0;
}

This is my code. vs code uploads the code to arduino in 6.36 seconds and sends back the successful message. But when the button connected to the pin number 6 is pressed, the green led does not light up. The red led does not light up when the program is running for the first time. The red light does not light up when the button connected to pin number 2 is pressed. But when I upload the code via the arduino idle, the code works the way I want it.

Above, I am sharing screenshot of the message I received after uploading the code.

I’am sharing platform.ini file.

This must be a volatile int start = 0; if you are modifying it in the ISR.