AutoGeneratedDocs
 
Loading...
Searching...
No Matches
HTL_onboard Class Reference

Library for controlling onboard hardware components including HEX display, LED stripe, and RGB LED. More...

#include <HTL_onboard.h>

Public Member Functions

 HTL_onboard ()
 
void begin ()
 Initializes the HTL_onboard library.
 
void writeHex (int8_t hexNumber)
 Writes a hexadecimal number to the HEX display.
 
void writeInt (int8_t intNumber)
 Writes an integer to the HEX display.
 
void writeChar (char c)
 Display a character on the 7-segment display.
 
void writeBinary (int binValue)
 Writes a binary value to the LED stripe.
 
void writeProgress (int progressValue)
 Writes a value to the LED stripe in Progress Bar form.
 
void setLED (int pin)
 Sets a specific LED on the LED stripe.
 
void clearLED (int pin)
 Clears a specific LED on the LED stripe.
 
void clearStripe ()
 Clears all LEDs on the LED stripe (turns them off).
 
void setRGB (uint8_t red, uint8_t green, uint8_t blue)
 Sets the RGB LED to the specified color.
 
int readSwitchState ()
 Reads the state of the switches.
 
int readPot ()
 Reads the potentiometer value.
 
void setMode (int mode, bool state)
 Sets the mode of the HTL_onboard.
 
void cfgSwitches (int switch1Threshold, int switchNoneThreshold, int switch12Threshold)
 Configures the switch thresholds.
 
void updateMultiplex ()
 Updates all displays. Call this function in loop()
 
void setModesMultiplex (const int modes[], int size)
 Sets the modes which are used to display in multiplex operation.
 
void setMultiplexInterval (int multiplexInterval)
 Sets the interval for multiplexing between different display modes.
 
void setHexMode (int mode)
 Sets the display mode of the HEX display.
 
int getHexMode ()
 Gets the current display mode of the HEX display.
 
void setHexNumber (int number)
 Sets the number to be displayed on the HEX display.
 
int getHexNumber ()
 Gets the number/character currently displayed on the HEX display.
 
void setChar (char c)
 Sets the character to be displayed on the HEX display.
 
void setString (String str)
 Sets the string to be displayed on the HEX display.
 
String getString ()
 Gets the string to be displayed on the HEX display.
 
void setStripeMode (int mode)
 Sets the display mode of the LED Stripe.
 
int getStripeMode ()
 Gets the current display mode of the LED Stripe.
 
void setRGB_Multiplex (uint8_t red, uint8_t green, uint8_t blue)
 Sets the RGB Values used in Multiplex Mode.
 
void setRed (uint8_t r)
 Sets the intensity of the red component of the RGB LED.
 
void setGreen (uint8_t g)
 Sets the intensity of the green component of the RGB LED.
 
void setBlue (uint8_t b)
 Sets the intensity of the blue component of the RGB LED.
 
uint8_t getRed ()
 Gets the intensity of the red component of the RGB LED.
 
uint8_t getGreen ()
 Gets the intensity of the green component of the RGB LED.
 
uint8_t getBlue ()
 Gets the intensity of the blue component of the RGB LED.
 
void setStringDelay (int stringDelay)
 Sets the delay of how long to display a character in string display mode.
 
int getStringDelay ()
 Gets the delay of how long to display a character in string display mode.
 
void setLedStripeValue (int value)
 Sets the value of the LED stripe.
 
int getLedStripeValue ()
 Gets the current value of the LED stripe.
 

Detailed Description

Library for controlling onboard hardware components including HEX display, LED stripe, and RGB LED.

This library provides functions to control various onboard hardware components of the HTL Uno, including a HEX display, LED stripe, and RGB LED. It allows for displaying hexadecimal and integer values on the HEX display, controlling individual LEDs on the LED stripe, setting colors on the RGB LED, reading switch states, and reading the value of a potentiometer.

Tobias Weich 2024

Constructor & Destructor Documentation

◆ HTL_onboard()

HTL_onboard::HTL_onboard ( )

Member Function Documentation

◆ begin()

void HTL_onboard::begin ( )

Initializes the HTL_onboard library.

Sets up pin modes for all necessary pins.

◆ cfgSwitches()

void HTL_onboard::cfgSwitches ( int switch1Threshold,
int switchNoneThreshold,
int switch12Threshold )

Configures the switch thresholds.

Parameters
switch1ThresholdThreshold for switch 1.
switchNoneThresholdThreshold for no switch pressed.
switch12ThresholdThreshold for both switches pressed.

◆ clearLED()

void HTL_onboard::clearLED ( int pin)

Clears a specific LED on the LED stripe.

This function turns off the specified LED on the LED stripe by setting its corresponding pin to HIGH.

Parameters
pinThe pin number of the LED to clear (0 to 9).

◆ clearStripe()

void HTL_onboard::clearStripe ( )

Clears all LEDs on the LED stripe (turns them off).

◆ getBlue()

uint8_t HTL_onboard::getBlue ( )

Gets the intensity of the blue component of the RGB LED.

Returns
uint8_t The intensity of the blue component (0 to 255).

◆ getGreen()

uint8_t HTL_onboard::getGreen ( )

Gets the intensity of the green component of the RGB LED.

Returns
uint8_t The intensity of the green component (0 to 255).

◆ getHexMode()

int HTL_onboard::getHexMode ( )

Gets the current display mode of the HEX display.

Returns
int The current display mode (0 for HEX, 1 for Decimal, 2 for Character, 3 for String).

◆ getHexNumber()

int HTL_onboard::getHexNumber ( )

Gets the number/character currently displayed on the HEX display.

Returns
int The number/character displayed on the HEX display as int.

◆ getLedStripeValue()

int HTL_onboard::getLedStripeValue ( )

Gets the current value of the LED stripe.

Returns
int The current value of the LED stripe (0 to 1023).

◆ getRed()

uint8_t HTL_onboard::getRed ( )

Gets the intensity of the red component of the RGB LED.

Returns
uint8_t The intensity of the red component (0 to 255).

◆ getString()

String HTL_onboard::getString ( )

Gets the string to be displayed on the HEX display.

Returns
String The string being displayed.

◆ getStringDelay()

int HTL_onboard::getStringDelay ( )

Gets the delay of how long to display a character in string display mode.

Returns
int The delay in ms.

◆ getStripeMode()

int HTL_onboard::getStripeMode ( )

Gets the current display mode of the LED Stripe.

Returns
int The current display mode (0 for Binary, 1 for Progress).

◆ readPot()

int HTL_onboard::readPot ( )

Reads the potentiometer value.

Returns
int The analog value from the potentiometer (0-1023).

◆ readSwitchState()

int HTL_onboard::readSwitchState ( )

Reads the state of the switches.

Returns
int Returns 2 if switch 2 is pressed, 3 if switch 3 is pressed, 1 if both switches are pressed, and 0 if no switch is pressed.

◆ setBlue()

void HTL_onboard::setBlue ( uint8_t b)

Sets the intensity of the blue component of the RGB LED.

Parameters
bThe intensity of the blue component (0 to 255).

◆ setChar()

void HTL_onboard::setChar ( char c)

Sets the character to be displayed on the HEX display.

Parameters
cThe character to display (ASCII).

◆ setGreen()

void HTL_onboard::setGreen ( uint8_t g)

Sets the intensity of the green component of the RGB LED.

Parameters
gThe intensity of the green component (0 to 255).

◆ setHexMode()

void HTL_onboard::setHexMode ( int mode)

Sets the display mode of the HEX display.

Parameters
modeThe mode to set (0 for HEX, 1 for Decimal, 2 for Character).

◆ setHexNumber()

void HTL_onboard::setHexNumber ( int number)

Sets the number to be displayed on the HEX display.

Parameters
numberThe number to display (-15 to 15 in HEX mode, -19 to 19 in Decimal mode).

◆ setLED()

void HTL_onboard::setLED ( int pin)

Sets a specific LED on the LED stripe.

Parameters
pinThe pin number of the LED to set (0 to 9).

◆ setLedStripeValue()

void HTL_onboard::setLedStripeValue ( int value)

Sets the value of the LED stripe.

Parameters
valueThe value to set (0 to 1023).

◆ setMode()

void HTL_onboard::setMode ( int mode,
bool state )

Sets the mode of the HTL_onboard.

Parameters
modeThe mode to set (0 for HEX, 1 for LED stripe, 2 for RGB).
stateThe state to set the mode to (true for active, false for inactive).

◆ setModesMultiplex()

void HTL_onboard::setModesMultiplex ( const int modes[],
int size )

Sets the modes which are used to display in multiplex operation.

Parameters
modesarray of modes that are displayed in Multiplex mode. (0 for HEX, 1 for LED stripe, 2 for RGB)

◆ setMultiplexInterval()

void HTL_onboard::setMultiplexInterval ( int multiplexInterval)

Sets the interval for multiplexing between different display modes.

This function sets the interval, in milliseconds, for how frequently the system cycles through the different active display modes (HEX, LED stripe, RGB). The provided interval must be non-negative.

Parameters
multiplexIntervalThe time interval in milliseconds for multiplexing. Must be a non-negative integer.

◆ setRed()

void HTL_onboard::setRed ( uint8_t r)

Sets the intensity of the red component of the RGB LED.

Parameters
rThe intensity of the red component (0 to 255).

◆ setRGB()

void HTL_onboard::setRGB ( uint8_t red,
uint8_t green,
uint8_t blue )

Sets the RGB LED to the specified color.

Parameters
redThe red intensity (0 to 255).
greenThe green intensity (0 to 255).
blueThe blue intensity (0 to 255).

◆ setRGB_Multiplex()

void HTL_onboard::setRGB_Multiplex ( uint8_t red,
uint8_t green,
uint8_t blue )

Sets the RGB Values used in Multiplex Mode.

Parameters
redThe red intensity (0 to 255).
greenThe green intensity (0 to 255).
blueThe blue intensity (0 to 255).

◆ setString()

void HTL_onboard::setString ( String str)

Sets the string to be displayed on the HEX display.

The string gets displayed character by character, with each character being displayed for strDelay (ms). Displaying strings is only supported for Multiplex mode, for Hex_mode only use setChar or only activate HEX mode

Parameters
strThe string to display (ASCII).

◆ setStringDelay()

void HTL_onboard::setStringDelay ( int stringDelay)

Sets the delay of how long to display a character in string display mode.

Parameters
msThe delay in ms.

◆ setStripeMode()

void HTL_onboard::setStripeMode ( int mode)

Sets the display mode of the LED Stripe.

Parameters
modeThe mode to set (0 for Binary, 1 for Progress).

◆ updateMultiplex()

void HTL_onboard::updateMultiplex ( )

Updates all displays. Call this function in loop()

◆ writeBinary()

void HTL_onboard::writeBinary ( int binValue)

Writes a binary value to the LED stripe.

Parameters
binValueThe binary value to display (0 to 1023).

◆ writeChar()

void HTL_onboard::writeChar ( char c)

Display a character on the 7-segment display.

Displaying characters is supported in Multiplex mode

This function attempts to display the provided character on the 7-segment display. If the character is not directly supported, it will attempt to display the uppercase or lowercase equivalent. If the character is still unsupported, it defaults to displaying '0'.

Parameters
cThe character to display.

◆ writeHex()

void HTL_onboard::writeHex ( int8_t hexNumber)

Writes a hexadecimal number to the HEX display.

Parameters
hexNumberThe hexadecimal number to display (-1F to 1F).

◆ writeInt()

void HTL_onboard::writeInt ( int8_t intNumber)

Writes an integer to the HEX display.

Parameters
intNumberThe integer number to display (-19 to 19).

◆ writeProgress()

void HTL_onboard::writeProgress ( int progressValue)

Writes a value to the LED stripe in Progress Bar form.

Parameters
progressValueThe progress value to display (0 to 10).

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