Options
All
  • Public
  • Public/Protected
  • All
Menu

@matthiaswillem/7-segment_display

7-segment display

npm badge ESLint Markdown Linter License

Exam assignment 2020 - Software Engineering Matthias Willem

A TypeScript library that can display temperature data in the console in LCD style according to following format:

 ______________________
|   _    _        _  _ |
| | _|   _||_|   |_||  |
| ||_  / _|  |      |_ |
|______________________|

Installation

Installing the package

This package package is available on npmjs.com. Check it out!

Just run this command:

npm i @matthiaswillem/7-segment_display

Building a package

If you want to create a package yourself

Programs

Node.js

Visit website

Visual Studio Code ( Not really necessary but it is useful )

Visit website

Command line

Install npm

npm install npm@latest -g

Install typescript

npm install -g typescript

Install ts-node

npm install -g ts-node

Documentation

The documentation of the package can you find at the GitHub Pages

Examples

Here I will give you some examples for using this package. The main method is:

 display(temperature: number, frame: boolean)

In the first parameter temperature, you can give a number what the temperature should be. In the second parameter frame, you can the method you want a frame (true) or not (false).

With border

An example command

display(12.34291, true)

The output

 ________________________
|     _    _        _  _ |
|  |  _|   _||_|   |_||  |
|  | |_  / _|  |      |_ |
|________________________|

Without border

An example Command

display(6, false)

The output

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

Versions

All NPM versions are the same of the github versions tags.

0.0.0

Project Setup

Added some files:

  • README file
  • LICENCE file
  • Markdown Linter by commit
  • ES Linter Checker by commit
  • NPM Package
  • Jest test file
  • .gitIgnore file

Edited some files:

  • README
    • Added
      • Badges
        • NPM Version
        • License
        • ESLint Check
        • Markdown Check
      • Discription
      • Installation
      • Versions
      • License
      • Author information
  • display.ts
    • Added
      • Example
  • display.test.ts
    • Added
      • Example

0.1.0

Project Start - Read the temperature

Edited some files:

  • README
    • Added
      • New version (0.1.0)
  • display.ts
    • Removed
      • Example
    • Added
      • setTemp()
      • getTemp()
      • getRoundedTemp()
  • display.test.ts
    • Removed
      • Example
    • Added
      • Some tests for testing all new methods

0.1.1

Put temperature chars into array + read

Edited some files:

  • README
    • Added
      • New version (0.1.1)
  • display.ts
    • Added
      • getTempNumbArray()
      • getTempArrayValue(index: number)
      • tempToArray()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.2

Doesn't exist anymore. I removed it for a small bugfix and didn't noticed you can't ever publish the same version again after you removed one.

You can find more info here about it.

0.1.3

Array of the whole temperature

Edited some files:

  • README
    • Added
      • Version problem 0.1.2
      • New version (0.1.3)
  • display.ts
    • Added
      • getTempArray()
      • buildTempArray()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.4

Printing temperature array in one string

Edited some files:

  • README
    • Added
      • New version (0.1.4)
  • display.ts
    • Added
      • printDisplay()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.5

Reworked printDisplay method Cleaner, DRY code. Removed spaces between numbers

Edited some files:

  • README
    • Added
      • New version (0.1.5)
  • display.ts
    • Modified
      • printDisplay()

0.1.6

Added everywhere default the °C symbol.

Edited some files:

  • README
    • Added
      • new version (0.1.6)
  • display.ts
    • Modified
      • buildTempArray()
      • setTemp(value: number)
  • display.test.ts
    • Modified
      • All tests added the °C symbol

0.2.0

The basics work (No Frame, no 2x Font)

Fully rebuild project:

  • Separated much methods in some other methods for the Single Responsibility Principle (SRP)
  • Changed much names of methods
  • Had to change the tests too (And remove some)
  • Added documentation

Edited some files:

  • README
    • Added
      • Documentation (GitHub Pages)
      • New minor version (0.2.0)
  • docs
    • Added docs directory for github pages
  • display.ts
    • Added
      • setTempNumb(temperature: number)
      • getTempNumb()
      • tempNumbRound()
      • temperatureAddCelcius()
      • setTemperature(temperature: number)
      • getTemperature()
      • temperatureToArray()
      • getTemperatureArray()µ
      • checkAndBuildChar(tempArrChar: number, tempChar: number)
      • buildDisplayArray()
      • getDisplayArray()
      • resetOutput()
      • resetIndentation()
      • printFirstRow()
      • printSecondAndThirdRow()
      • changeIndentation(row: number)
      • printDisplay()
    • Removed
      • setTemp(value: number)
      • getTemp()
      • getRoundedTemp()
      • getTempNumbArray()
      • getTempArrayValue(index: number)
      • tempToArray()
      • getTempArray()
      • printDisplay()
      • buildTempArray()
  • display.test.ts
    • Modified
      • All tests are modified with the correct names

0.3.0

Added the frame to the project

Edited some files:

  • README
    • Added
      • New minor version (0.3.0)
      • Examples
  • docs
    • Added
      • The new methods
  • display.ts
    • Added
      • checkBorder(border: boolean)
      • createHorBorderTop(border: boolean)
      • createHorBorderBottom(border: boolean)
      • display(temperature: number, frame: boolean)
    • modified
      • printDisplay(frame: boolean)
      • changeIndentation(row: number)
      • printFirstRow()
      • resetOutput()
      • one[] (for better layout)
  • display.test.ts
    • Added
      • 2 new tests for printDisplay(true)
      • 2 new tests for display(temperature: number, frame: boolean)

Licence

This project is licensed under the MIT License - see the LICENSE file for details

Author information

Matthias Willem

Student Electronics-ICT VIVES Bruges

Generated using TypeDoc