npm package: @lauradebaets/examenopdracht
Description: a LCD Display that can show the Temperature. You can choose size of the letter and with or without frame.
Author: De Baets Laura
Latest version: 0.3.0

# Examenopdracht 2020 - Temperatuur LCD Display - De Baets Laura

![npm badge](https://img.shields.io/badge/npm-v0.3.0-blue.svg)

![ESLint](https://github.com/vives-software-engineering-2020/examenopdracht-debaetslaura/workflows/ESLint/badge.svg?branch=master)

![Markdown Linter](https://github.com/vives-software-engineering-2020/examenopdracht-debaetslaura/workflows/Markdown%20Linter/badge.svg?branch=master)

![Tests](https://github.com/vives-software-engineering-2020/examenopdracht-debaetslaura/workflows/Tests/badge.svg?branch=master)

## 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:

```text
 ___________________________
|    _     _        _   _   |
|  | _|    _||_|   |_| |    |
|  ||_  /  _|  |       |_   |
|___________________________|
```

## Installation instructions

You must have typescript!!! otherwise ->

```sh
npm install -g typescript
```

Installing the home-automation for windows:

```sh
npm i @lauradebaets/home-automation
```

To run the library with the index.ts:

```sh
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.

```ts
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.

```ts
const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
```

The line below then ensures that the temperature is printed in the console.

```ts
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.

```ts
const application = new App({temperature: "-123456789, °C",size:"normal",border: false})
application.getLCD()
```

Below you see the output of the getLCD () method.

```text
       _  _     _  _  _  _  _        _  _
 _   | _| _||_||_ |_   ||_||_|      |_||
     ||_  _|  | _||_|  ||_| _| /       |_

```

#### Normal size and with frame

```ts
const application = new App({temperature: "-123456789, °C",size:"normal",border: true})
application.getLCD()
```

```text
 ____________________________________________
|        _  _     _  _  _  _  _        _  _  |
|  _   | _| _||_||_ |_   ||_||_|      |_||   |
|      ||_  _|  | _||_|  ||_| _| /       |_  |
|____________________________________________|

```

#### Big size and without frame

```ts
const application = new App({temperature: "-123456789, °C",size:"big",border: false})
application.getLCD()
```

```text
           ___  ___       ___  ___  ___  ___  ___            ___  ___
         |    |    ||   ||    |        ||   ||   |          |   ||
         |    |    ||   ||    |        ||   ||   |          |   ||
 ___       ___  ___  ___  ___  ___       ___  ___            ___
         ||        |    |    ||   |    ||   |    |               |
         ||        |    |    ||   |    ||   |    |   /           |
           ___  ___       ___  ___       ___  ___   /             ___

```

#### Big size and with frame

```ts
const application = new App({temperature: "-123456789, °C",size:"big",border: true})
application.getLCD()
```

```text
 ________________________________________________________________________
|            ___  ___       ___  ___  ___  ___  ___            ___  ___  |
|          |    |    ||   ||    |        ||   ||   |          |   ||     |
|          |    |    ||   ||    |        ||   ||   |          |   ||     |
|  ___       ___  ___  ___  ___  ___       ___  ___            ___       |
|          ||        |    |    ||   |    ||   |    |               |     |
|          ||        |    |    ||   |    ||   |    |   /           |     |
|            ___  ___       ___  ___       ___  ___   /             ___  |
|________________________________________________________________________|

```

#### Frame is dependent of the length

As you can see here, the frame depends on how many digits you have.

```ts
const application = new App({temperature: "100°C",size:"big",border: true})
application.getLCD()
```

```text
 _________________
|     _  _  _  _  |
|   || || ||_||   |
|   ||_||_|   |_  |
|_________________|

```

#### Youtube

Look at the video with examples. You can watch the video below here.

[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/YIStxRE1V3U/0.jpg)](https://www.youtube.com/watch?v=YIStxRE1V3U)

## NPM

Here you can visit the npm website -> [npm](https://www.npmjs.com/package/@lauradebaets/home-automation)

## Tests

Tests have been made to develop this library. The tests are all successful, see image below:

![test_succes](/img/npm_test_succes.png)

To run the tests use the following command:

```sh
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.

```sh
npm run lint
```

## Generated documentation

TypeDoc is used to generate the documentation. Tor run it, you must run the following commando

```sh
typedoc --out docs src
```

The documentation can be see [here](https://vives-software-engineering-2020.github.io/examenopdracht-debaetslaura/.)

## License

Distributed under the MIT License. See ``License.txt``  for more information.

## Sources

The split() method: [see here](https://www.samanthaming.com/tidbits/83-4-ways-to-convert-string-to-character-array/)

## Author information

De Baets Laura

Student at VIVES Brugge Elektronica -ICT, 2nd year

e-mail: laura.debaets@student.vives.be