Options
All
  • Public
  • Public/Protected
  • All
Menu

@lauradebaets/examenopdracht

Examenopdracht 2020 - Temperatuur LCD Display - De Baets Laura

npm badge

ESLint

Markdown Linter

Tests

Description

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:

 ___________________________
|    _     _        _   _   |
|  | _|    _||_|   |_| |    |
|  ||_  /  _|  |       |_   |
|___________________________|

Installation instructions

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

Multiple usage instructions and examples

General usage

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.

  • At the temperature you can only enter the following characters: "0123456789, ° C"
  • With the size you can choose between normal and big
  • At the border you have to give if you want a frame.(true = with frame, false = without 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()

Examples of the LCD library

Normal size and without frame

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.

       _  _     _  _  _  _  _        _  _
 _   | _| _||_||_ |_   ||_||_|      |_||
     ||_  _|  | _||_|  ||_| _| /       |_

Normal size and with frame

const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
application.getLCD()
 ____________________________________________
|        _  _     _  _  _  _  _        _  _  |
|  _   | _| _||_||_ |_   ||_||_|      |_||   |
|      ||_  _|  | _||_|  ||_| _| /       |_  |
|____________________________________________|

Big size and without frame

const application = new App({temperature: "-123456789, °C",size:"big",border: false})
application.getLCD()
           ___  ___       ___  ___  ___  ___  ___            ___  ___
         |    |    ||   ||    |        ||   ||   |          |   ||
         |    |    ||   ||    |        ||   ||   |          |   ||
 ___       ___  ___  ___  ___  ___       ___  ___            ___
         ||        |    |    ||   |    ||   |    |               |
         ||        |    |    ||   |    ||   |    |   /           |
           ___  ___       ___  ___       ___  ___   /             ___

Big size and with frame

const application = new App({temperature: "-123456789, °C",size:"big",border: true})
application.getLCD()
 ________________________________________________________________________
|            ___  ___       ___  ___  ___  ___  ___            ___  ___  |
|          |    |    ||   ||    |        ||   ||   |          |   ||     |
|          |    |    ||   ||    |        ||   ||   |          |   ||     |
|  ___       ___  ___  ___  ___  ___       ___  ___            ___       |
|          ||        |    |    ||   |    ||   |    |               |     |
|          ||        |    |    ||   |    ||   |    |   /           |     |
|            ___  ___       ___  ___       ___  ___   /             ___  |
|________________________________________________________________________|

Frame is dependent of the length

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()
 _________________
|     _  _  _  _  |
|   || || ||_||   |
|   ||_||_|   |_  |
|_________________|

Youtube

Look at the video with examples. You can watch the video below here.

IMAGE ALT TEXT HERE

NPM

Here you can visit the npm website -> npm

Tests

Tests have been made to develop this library. The tests are all successful, see image below:

test_succes

To run the tests use the following command:

npm run test

Linter

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

Generated documentation

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

License

Distributed under the MIT License. See License.txt for more information.

Sources

The split() method: see here

Author information

De Baets Laura

Student at VIVES Brugge Elektronica -ICT, 2nd year

e-mail: laura.debaets@student.vives.be

Generated using TypeDoc