uint8_t digitPins[] = { 11, 2, 3, 5 };
uint8_t segmentPins[] = { 12, 4, 7, 9, 10, 13, 6, 8 };
uint8_t alpha[4][8] = {
  { 1, 1, 0, 0, 1, 1, 1, 0 },
  { 0, 0, 0, 0, 1, 1, 0, 0 }, 
  { 1, 0, 0, 1, 1, 1, 0, 0 }, 
  { 1, 1, 1, 1, 1, 1, 0, 0 }
  };
int main() {
  for (uint8_t i = 0; i < 4; i++) {
    _gpio_init(digitPins[i]);
    gpio_set_dir(digitPins[i], GPIO_OUT);
  }
  for (uint8_t i = 0; i < 8; i++) {
    _gpio_init(segmentPins[i]);
    gpio_set_dir(segmentPins[i], GPIO_OUT);
  }
  while (true) {
    for (uint8_t dig = 0; dig < 4; dig++)
    {
      gpio_put(digitPins[dig], 1);
      for (uint8_t seg = 0; seg < 8; seg++) {
        if (alpha[dig][seg] == 0) {
          gpio_put(segmentPins[seg], 1);
        } else {
          gpio_put(segmentPins[seg], 0);
        }
      }
      sleep_ms(200);
      gpio_put(digitPins[dig], 0);
      sleep_ms(100);
    }
    for (uint8_t i = 0; i < 4; i++) {
      gpio_put(digitPins[i], 0);
    }
    for (uint8_t i = 0; i < 8; i++) {
      gpio_put(segmentPins[i], 0);
    }
  }
  return 0;
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT