Package frc.lib.util
Class MorseCode
java.lang.Object
frc.lib.util.MorseCode
A library for using Morse Code
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateDirColorArray(String word, int unit, Color primaryColor) Generates an array of color objects to pass to the LED controller.generateDirColorArray(ArrayList<Boolean> finalWord, Color primaryColor) Generates an array of color objects to pass to the LED controller.generateDitArray(String word, int unit) Generate an array of True or False values to indicate On or Off.generateMorseCodeAlphabet(int unit) Generate a Map of dots and dashes for each character in the Morse Code Alphabet
-
Field Details
-
morseJSON
public static com.fasterxml.jackson.databind.JsonNode morseJSON
-
-
Constructor Details
-
MorseCode
public MorseCode()
-
-
Method Details
-
generateMorseCodeAlphabet
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
Generate an array of True or False values to indicate On or Off.- Parameters:
word- The Word or Sentence to convert to Morse Codeunit- 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
Generates an array of color objects to pass to the LED controller.- Parameters:
word- The Word or Sentence to convert to Morse Codeunit- The base unit/length of time for the conversionprimaryColor- The color to use when the array value is.- Returns:
- An array of color objects.
-