Copyright | (c) Levent Erkok |
---|---|
License | BSD3 |
Maintainer | erkokl@gmail.com |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Character to 7-segment display conversion.
Documentation
char2SS :: Char -> Maybe Word8 Source
Convert a character to a bit-pattern, suitable for display on a seven-segment display.
Note that most characters are just not representable in a 7-segment display, in which
case we map it to Nothing
. However, some substitutions are done, for instance '(' is
displayed the same as '['.
The return value is a Word8
, although only 7-bits are used; the least significant bit will
always be 0. With the traditional coding, the bits correspond to segments ABCDEFG0, i.e.,
most-significant-bit will be for segment A, next for segment B, and so on.