Package frc.lib.util

Class MorseCode

java.lang.Object
frc.lib.util.MorseCode

public class MorseCode extends Object
A library for using Morse Code
  • Field Details

    • morseJSON

      public static com.fasterxml.jackson.databind.JsonNode morseJSON
  • Constructor Details

    • MorseCode

      public MorseCode()
  • Method Details

    • generateMorseCodeAlphabet

      public static Map<String,ArrayList<Integer>> generateMorseCodeAlphabet(int unit)
      Generate a Map of dots and dashes for each character in the Morse Code Alphabet
      Parameters:
      unit - The length of a unit
      Returns:
      A map of characters to dot-dash codes
    • generateDitArray

      public static ArrayList<Boolean> generateDitArray(String word, int unit)
      Generate an array of True or False values to indicate On or Off.
      Parameters:
      word - The Word or Sentence to convert to Morse Code
      unit - The base unit/length of time for the conversion
      Returns:
      An array of True/False
    • generateDirColorArray

      public static ArrayList<Color> generateDirColorArray(ArrayList<Boolean> finalWord, Color primaryColor)
      Generates an array of color objects to pass to the LED controller.
      Parameters:
      finalWord - An array of True/False values.
      primaryColor - The color to use when the array value is.
      Returns:
      An array of color objects.
    • generateDirColorArray

      public static ArrayList<Color> generateDirColorArray(String word, int unit, Color primaryColor)
      Generates an array of color objects to pass to the LED controller.
      Parameters:
      word - The Word or Sentence to convert to Morse Code
      unit - The base unit/length of time for the conversion
      primaryColor - The color to use when the array value is.
      Returns:
      An array of color objects.