CrossGuard
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LED Class Reference

Controls an LED connected to a GPIO pin. More...

#include <LED.h>

Public Member Functions

 LED (int pin)
 Constructor that initializes an LED object attached to a specified GPIO pin.
 
void on ()
 Turns the LED on by setting the GPIO pin high.
 
void off ()
 Turns the LED off by setting the GPIO pin low.
 

Detailed Description

Controls an LED connected to a GPIO pin.

This class provides methods to turn an LED on and off, abstracting the hardware interfacing details.

Constructor & Destructor Documentation

◆ LED()

LED::LED ( int pin)

Constructor that initializes an LED object attached to a specified GPIO pin.

Constructor for the LED class.

Parameters
pinGPIO pin number that the LED is connected to.

This constructor initializes the GPIO pin used by the LED and sets it to output mode, preparing the LED for use.

Parameters
pinThe GPIO pin number connected to the LED.

Member Function Documentation

◆ off()

void LED::off ( )

Turns the LED off by setting the GPIO pin low.

Turn the LED off.

This method sets the GPIO pin to low, turning the LED off.

◆ on()

void LED::on ( )

Turns the LED on by setting the GPIO pin high.

Turn the LED on.

This method sets the GPIO pin to high, which turns the LED on.


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