Arduino TKJHAT
Arduino library for Pico HAT extension board
Loading...
Searching...
No Matches
Led Class Reference

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.

Detailed Description

A class to control simple red LED.

This is for the red LED (GPIO 14)

  • Pin:
    Function Macro GPIO
    Red LED RED_LED_PIN / LED1 14

{@

Constructor & Destructor Documentation

◆ Led()

Led::Led ( uint8_t pin)

Construct a new Led object.

Parameters
pinGPIO pin connected to the LED

Member Function Documentation

◆ blink()

void Led::blink ( int n)

Blink the LED a given number of times.

Parameters
nNumber of times to blink

◆ set()

void Led::set ( bool status)

Set the LED on or off.

Parameters
statusSet to true to turn the LED on, false to turn it off

◆ toggle()

void Led::toggle ( )

Toggle the LED state.

Switches the LED from ON to OFF or from OFF to ON, depending on its current state


The documentation for this class was generated from the following file: