This library was created using typescript. It displays the temperature in an LCD style in the console. Below you can see the output of this library:
___________________________
| _ _ _ _ |
| | _| _||_| |_| | |
| ||_ / _| | |_ |
|___________________________|
You must have typescript!!! otherwise ->
npm install -g typescript
Installing the home-automation for windows:
npm i @lauradebaets/home-automation
To run the library with the index.ts:
ts-node ./index.ts
If you want to use the library you just have to add these 2 lines in your program.
const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
application.getLCD()
On this line below you must give the temperature, the size and say if you want a frame.
You can change the order. this does not affect the operation of the library.
const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
The line below then ensures that the temperature is printed in the console.
application.getLCD()
This code is in the index.ts. These are the 2 lines of code that you must integrate in your program to use the library.
const application = new App({temperature: "-123456789, °C",size:"normal",border: false})
application.getLCD()
Below you see the output of the getLCD () method.
_ _ _ _ _ _ _ _ _
_ | _| _||_||_ |_ ||_||_| |_||
||_ _| | _||_| ||_| _| / |_
const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
application.getLCD()
____________________________________________
| _ _ _ _ _ _ _ _ _ |
| _ | _| _||_||_ |_ ||_||_| |_|| |
| ||_ _| | _||_| ||_| _| / |_ |
|____________________________________________|
const application = new App({temperature: "-123456789, °C",size:"big",border: false})
application.getLCD()
___ ___ ___ ___ ___ ___ ___ ___ ___
| | || || | || || | | ||
| | || || | || || | | ||
___ ___ ___ ___ ___ ___ ___ ___ ___
|| | | || | || | | |
|| | | || | || | | / |
___ ___ ___ ___ ___ ___ / ___
const application = new App({temperature: "-123456789, °C",size:"big",border: true})
application.getLCD()
________________________________________________________________________
| ___ ___ ___ ___ ___ ___ ___ ___ ___ |
| | | || || | || || | | || |
| | | || || | || || | | || |
| ___ ___ ___ ___ ___ ___ ___ ___ ___ |
| || | | || | || | | | |
| || | | || | || | | / | |
| ___ ___ ___ ___ ___ ___ / ___ |
|________________________________________________________________________|
As you can see here, the frame depends on how many digits you have.
const application = new App({temperature: "100°C",size:"big",border: true})
application.getLCD()
_________________
| _ _ _ _ |
| || || ||_|| |
| ||_||_| |_ |
|_________________|
Look at the video with examples. You can watch the video below here.
Here you can visit the npm website -> npm
Tests have been made to develop this library. The tests are all successful, see image below:
To run the tests use the following command:
npm run test
There is also a linter is this project. Linter analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. To use the linter you have to run the following command.
npm run lint
TypeDoc is used to generate the documentation. Tor run it, you must run the following commando
typedoc --out docs src
The documentation can be see here
Distributed under the MIT License. See License.txt
for more information.
The split() method: see here
De Baets Laura
Student at VIVES Brugge Elektronica -ICT, 2nd year
e-mail: laura.debaets@student.vives.be
Generated using TypeDoc