2.Button
This examples shows how to use the debounced Button class to toggle an LED.
- Boards: 🛈
- AVR, AVR USB, Nano Every, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Due, Teensy 3.x, ESP8266, ESP32
Connections
- 2: Momentary push button (other pin to ground)
The internal pull-up resistor will be enabled.
Behavior
- If you press the push button once, the built-in LED is turned on.
- If you press the button again, the LED is turned off again.
Written by PieterP, 2019-11-22
https://github.com/tttapa/Arduino-Helpers
}
void loop() {
}
}
constexpr PinStatus_t LOW
constexpr PinStatus_t HIGH
constexpr PinMode_t OUTPUT
Dummy header file for Arduino builder.
Array< T, N > copyAs(const Array< U, N > &src)
Copy an Array to an Array of a different type.
void digitalWrite(pin_t pin, PinStatus_t val)
An ExtIO version of the Arduino function.