Class FourDigitSevenSegmentDisplayHelper

java.lang.Object
com.opensourcewithslu.outputdevices.FourDigitSevenSegmentDisplayHelper

public class FourDigitSevenSegmentDisplayHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    FourDigitSevenSegmentDisplayHelper(com.pi4j.io.gpio.digital.DigitalOutput sdi, com.pi4j.io.gpio.digital.DigitalOutput rclk, com.pi4j.io.gpio.digital.DigitalOutput srclk, com.pi4j.io.gpio.digital.DigitalOutput digit0, com.pi4j.io.gpio.digital.DigitalOutput digit1, com.pi4j.io.gpio.digital.DigitalOutput digit2, com.pi4j.io.gpio.digital.DigitalOutput digit3)
    Constructor for the FourDigitSevenSegmentDisplayHelper class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the display.
    void
    Disables the display.
    void
    Enables the display.
    Gets the display value.
    void
    print(String value)
    Displays a value on the four-digit seven-segment display.
    void
    setDecimalPoint(int digit, boolean enabled)
    Sets the decimal point of a digit.
    void
    setDigit(int digit, char value)
    Sets the value of a digit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FourDigitSevenSegmentDisplayHelper

      public FourDigitSevenSegmentDisplayHelper(com.pi4j.io.gpio.digital.DigitalOutput sdi, com.pi4j.io.gpio.digital.DigitalOutput rclk, com.pi4j.io.gpio.digital.DigitalOutput srclk, com.pi4j.io.gpio.digital.DigitalOutput digit0, com.pi4j.io.gpio.digital.DigitalOutput digit1, com.pi4j.io.gpio.digital.DigitalOutput digit2, com.pi4j.io.gpio.digital.DigitalOutput digit3)
      Constructor for the FourDigitSevenSegmentDisplayHelper class.
      Parameters:
      sdi - Serial data input
      rclk - Register clock
      srclk - Shift register clock
      digit0 - The first digit
      digit1 - The second digit
      digit2 - The third digit
      digit3 - The fourth digit
  • Method Details

    • clear

      public void clear()
      Clears the display.
    • enable

      public void enable()
      Enables the display.
    • disable

      public void disable()
      Disables the display.
    • print

      public void print(String value)
      Displays a value on the four-digit seven-segment display.
      Parameters:
      value - The value to display. It can include digits 0-9, letters A-F (case-insensitive), hyphens, spaces, and decimal points.
    • getDisplayValue

      public String getDisplayValue()
      Gets the display value.
      Returns:
      The display value
    • setDigit

      public void setDigit(int digit, char value)
      Sets the value of a digit.
      Parameters:
      digit - The digit to set the value of (0-3)
      value - The value to set the digit to. Must be a digit 0-9, a letter A-F (case-insensitive), a hyphen, or a space
    • setDecimalPoint

      public void setDecimalPoint(int digit, boolean enabled)
      Sets the decimal point of a digit.
      Parameters:
      digit - The digit to set the decimal point of (0-3)
      enabled - Whether the decimal point should be enabled or not