2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
LED Class Reference

#include <LED.h>

Public Types

enum class  LEDPattern {
  SOLID = 0 , BLINK_FAST , BLINK_SLOW , PULSE_FAST ,
  PULSE_SLOW
}
 

Public Member Functions

 LED (uint8_t controlPin)
 
 LED (uint8_t controlPin, bool pwmEnable)
 
 LED (uint8_t controlPin, uint8_t groundPin, bool pwmEnable=false)
 
void Initialize ()
 
void Update ()
 
void On ()
 
void Off ()
 
bool GetIlluminated () const
 
void SetPattern (LEDPattern newPattern)
 
LEDPattern GetPattern () const
 
bool IsPWM () const
 

Private Member Functions

void SetPulse ()
 
void SetFlash ()
 
void SetSolid ()
 
uint8_t CalcPulseBrightness (uint8_t brightness, uint16_t period, bool smooth=false, uint8_t offBrightness=0)
 

Private Attributes

const uint8_t m_controlPin
 
const uint8_t m_groundPin
 
const bool m_pwmEnable
 
bool m_initialized
 
LEDPattern m_pattern
 
bool m_illuminate
 

Static Private Attributes

static uint8_t GAMMA [256]
 
static bool GAMMA_INITIALIZED = false
 

Member Enumeration Documentation

◆ LEDPattern

enum class LED::LEDPattern
strong
Enumerator
SOLID 
BLINK_FAST 
BLINK_SLOW 
PULSE_FAST 
PULSE_SLOW 

Constructor & Destructor Documentation

◆ LED() [1/3]

LED::LED ( uint8_t  controlPin)
explicit

◆ LED() [2/3]

LED::LED ( uint8_t  controlPin,
bool  pwmEnable 
)

◆ LED() [3/3]

LED::LED ( uint8_t  controlPin,
uint8_t  groundPin,
bool  pwmEnable = false 
)

Member Function Documentation

◆ CalcPulseBrightness()

uint8_t LED::CalcPulseBrightness ( uint8_t  brightness,
uint16_t  period,
bool  smooth = false,
uint8_t  offBrightness = 0 
)
private

◆ GetIlluminated()

bool LED::GetIlluminated ( ) const

◆ GetPattern()

LED::LEDPattern LED::GetPattern ( ) const

◆ Initialize()

void LED::Initialize ( )

◆ IsPWM()

bool LED::IsPWM ( ) const

◆ Off()

void LED::Off ( )

◆ On()

void LED::On ( )

◆ SetFlash()

void LED::SetFlash ( )
private

◆ SetPattern()

void LED::SetPattern ( LED::LEDPattern  newPattern)

◆ SetPulse()

void LED::SetPulse ( )
private

◆ SetSolid()

void LED::SetSolid ( )
private

◆ Update()

void LED::Update ( )

Member Data Documentation

◆ GAMMA

uint8_t LED::GAMMA
staticprivate

◆ GAMMA_INITIALIZED

bool LED::GAMMA_INITIALIZED = false
staticprivate

◆ m_controlPin

const uint8_t LED::m_controlPin
private

◆ m_groundPin

const uint8_t LED::m_groundPin
private

◆ m_illuminate

bool LED::m_illuminate
private

◆ m_initialized

bool LED::m_initialized
private

◆ m_pattern

LEDPattern LED::m_pattern
private

◆ m_pwmEnable

const bool LED::m_pwmEnable
private

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