Question.1
An LED class turns on in the constructor and off in the destructor:
class LED {
int pin;
public:
LED(int p) : pin(p) { gpio_set(pin, HIGH); }
~LED() { gpio_set(pin, LOW); }
};
void blink() {
LED led(13); // LED ON
delay(100);
} // LED OFFWhen does the LED turn off?