UNPKG

react-7-segment-display-plus

Version:

A react component that simulates a 7-segment display

23 lines (21 loc) 649 B
const charToDigit = { "0": [1, 1, 1, 1, 1, 1, 0], "1": [0, 1, 1, 0, 0, 0, 0], "2": [1, 1, 0, 1, 1, 0, 1], "3": [1, 1, 1, 1, 0, 0, 1], "4": [0, 1, 1, 0, 0, 1, 1], "5": [1, 0, 1, 1, 0, 1, 1], "6": [1, 0, 1, 1, 1, 1, 1], "7": [1, 1, 1, 0, 0, 0, 0], "8": [1, 1, 1, 1, 1, 1, 1], "9": [1, 1, 1, 1, 0, 1, 1], "@": [1, 1, 1, 1, 1, 0, 1], a: [1, 1, 1, 0, 1, 1, 1], b: [0, 0, 1, 1, 1, 1, 1], c: [1, 0, 0, 1, 1, 1, 0], d: [0, 1, 1, 1, 1, 0, 1], e: [1, 0, 0, 1, 1, 1, 1], f: [1, 0, 0, 0, 1, 1, 1], "-": [0, 0, 0, 0, 0, 0, 1], } as { [key: string]: number[] }; export default charToDigit;