Options
All
  • Public
  • Public/Protected
  • All
Menu

A Class created to make a 7-bit display. This class uses 2 classed named:

  • DrawSegment
  • PipeSegment

This class takes in a number from 0-9 and then prints the number out in 7-segment form.

import DrawSegment from './DrawSegment'
const segment = new DrawSegment(1); //Selects that we want to draw 1
segment.drawLines();    // Actually draws the 1 in the console.

This class has been used in the DrawBigSegment and Temperature Class.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • The class itself has 12 cases in the constructor for each printable digit: 0-9 and the ° sign and the C Celcius sign. For the constructor of the DrawSegment class I was inspired by the repository from SK-SpeedBit.

    Parameters

    • digit: number

    Returns DrawSegment

Properties

a

a: boolean = false

b

b: boolean = false

c

c: boolean = false

d

d: boolean = false

e

e: boolean = false

f

f: boolean = false

g

g: boolean = false

Methods

drawSegment

  • drawSegment(): string[]
  • The Drawsegment method is the method which takes care of printing the digit

    Returns string[]

returnStringArray

  • returnStringArray(top: string[], middle: string[], bottom: string[]): string[]
  • Parameters

    • top: string[]

      Is the top segment of the array.

    • middle: string[]

      Is the middle segment of the array.

    • bottom: string[]

      Is the bottom segment of the array.

    Returns string[]

Generated using TypeDoc