const int buttonPins[] = {D0,D1,D2,D3,D4,D5,D6,D7,D8,D9,D10};
const int numButtons = sizeof(buttonPins)/sizeof(int);

void setup() 
{
  Serial.begin(9600);
  Serial.println("Input Test");

  for (int i=0; i<numButtons; i++) 
    pinMode(buttonPins[i], INPUT_PULLUP);
}

void loop() 
{
  int array[numButtons];
  for(int i=0; i<numButtons; i++)
  {
    array[i] = digitalRead(buttonPins[i]);
  }

  for(int i=0; i<numButtons; i++)
  {
    if(array[i] == HIGH)
      Serial.print("#");
    else
      Serial.print("_");
  }
  Serial.println();
  delay(300);
}
Loading
xiao-esp32-c3