int led1 = 2;

class Led {
    int pin;
  public:
    Led(int pin) {
      this-> pin = pin;
      pinMode(pin, INPUT);
    }
    void blink() {
      digitalWrite(pin, HIGH);
      delay(500);
      digitalWrite(pin, LOW);
      delay(500);
    }
};


Led c1(led1);
void setup() {


}

void loop() {
  c1.blink();
}
Loading
esp32-devkit-v1