const int GPIO_Pins[] = {0,1,2,3};
const int numleds = 4;
int arr[5];

void setup() {
  for (int i=0; i<numleds ; i++)
  {
    pinMode(GPIO_Pins[i] , OUTPUT);
    digitalWrite(GPIO_Pins[i] , LOW);
  }
}

void loop() {
  for(int i=1 ; i<=15 ;i++)
  {
    binaryLED(i);
    delay(1000);
  }
  delay(2000);
}

void binaryLED(int num)
{
  for (int i=0 ; i<4 ; i++)
  {
    arr[i] = num%2;
    num = num/2;
    if(arr[i]==1)
    {
      digitalWrite(GPIO_Pins[i], HIGH);
    }
    if(arr[i]==0)
    {
      digitalWrite(GPIO_Pins[i], LOW);
    }
  }
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT