A class to control simple red LED. More...
#include <Led.h>
Public Member Functions | |
| void | begin () |
| Initialize the LED. | |
| void | blink (int n) |
| Blink the LED a given number of times. | |
| Led (uint8_t pin) | |
| Construct a new Led object. | |
| void | set (bool status) |
| Set the LED on or off. | |
| void | toggle () |
| Toggle the LED state. | |
A class to control simple red LED.
This is for the red LED (GPIO 14)
| Function | Macro | GPIO |
|---|---|---|
| Red LED | RED_LED_PIN / LED1 | 14 |
{@
| Led::Led | ( | uint8_t | pin | ) |
Construct a new Led object.
| pin | GPIO pin connected to the LED |
| void Led::blink | ( | int | n | ) |
Blink the LED a given number of times.
| n | Number of times to blink |
| void Led::set | ( | bool | status | ) |
Set the LED on or off.
| status | Set to true to turn the LED on, false to turn it off |
| void Led::toggle | ( | ) |
Toggle the LED state.
Switches the LED from ON to OFF or from OFF to ON, depending on its current state