temperature console printer is a typescript library to print a given temperature in the console in 7 segment style.
the library can be installed via the npm package manager:
npm install @jibed/segmentdisplay
With this you can print the temperature or a binary code in 7-segment style. when you want to print the temperature: you can write the temperature in the method:
supported chars:
you can also give an optional parameter: how many times you want the text to be bigger (default == 1). if you want a frame around the printed text (default == false).
import TempPrint;
console.log(TempPrint.printTemp("20,5°C"));
console.log(TempPrint.printTemp("20,5°C", true));
console.log(TempPrint.printTemp("20,5°C", true, 1));
_ _ _ _ _
_|| | |_ |_||
|_ |_| | _| |_
___________________________
| _ _ _ _ _ |
| _|| | |_ |_|| |
| |_ |_| | _| |_ |
|___________________________|
________________________________________________________
| |
| |
| |
| |
| _____ _____ _____ _____ _____ |
| || | | | || |
| || | | | || |
| || | | | || |
| || | | | || |
| _____|| | |_____ |_____|| |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |_____ |_____| | _____| |_____ |
| |
| |
| |
| |
|________________________________________________________|
it is also possible to enter binary code. you can enter a 8 bit binary code:
if you want to use binary code you need to set a b befor yout input and between every binary a '/'.
in the photo above you see the letters displayed: ABCDEFGH
if you want a line on the place of the letter, you need to write a 1 on the place of the letter. f.e.: 3 is 10110110 and 0 = 11011110 so for example the input for "30 °C" would be: b/10110110/11011110/00000000/11110000/11001100
import TempPrint;
console.log(TempPrint.printTempb("b/10110110/11011110/00000000/11110000/11001100"));
console.log(TempPrint.printTemp("b/10110110/11011110/00000000/11110000/11001100", true));
_ _ _ _
_|| | |_||
_||_| |_
_____________________
| _ _ _ _ |
| _|| | |_|| |
| _||_| |_ |
|_____________________|
when you use binary code, you can also use the supported characters inbetween them.
import TempPrint;
console.log(TempPrint.printTempb("b/3/11011110/ /°/11001100"));
console.log(TempPrint.printTemp("b/10110110/0/00000000/11110000/C", true));
_ _ _ _
_|| | |_||
_||_| |_
_____________________
| _ _ _ _ |
| _|| | |_|| |
| _||_| |_ |
|_____________________|
its not necessary to document your changes but I highly recommend it. For major changes, I'd prefer you discuss it with me
name: Jibe Defoor email: jibe.defoor@hotmail.com
Generated using TypeDoc