How to use the blessed-contrib.lcd function in blessed-contrib

To help you get started, we’ve selected a few blessed-contrib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wechaty / wechaty / examples / blessed-twins-bot / index.ts View on Github external
/*
 *
 * LCD Options
//these options need to be modified epending on the resulting positioning/size
  options.segmentWidth = options.segmentWidth || 0.06; // how wide are the segments in % so 50% = 0.5
  options.segmentInterval = options.segmentInterval || 0.11; // spacing between the segments in % so 50% = 0.5
  options.strokeWidth = options.strokeWidth || 0.11; // spacing between the segments in % so 50% = 0.5
//default display settings
  options.elements = options.elements || 3; // how many elements in the display. or how many characters can be displayed.
  options.display = options.display || 321; // what should be displayed before anything is set
  options.elementSpacing = options.spacing || 4; // spacing between each element
  options.elementPadding = options.padding || 2; // how far away from the edges to put the elements
//coloring
  options.color = options.color || "white";
*/
const lcdLineOne = grid.set(0, 9, 2, 3, contrib.lcd,
  {
    label: 'LCD Test',
    segmentWidth: 0.06,
    segmentInterval: 0.11,
    strokeWidth: 0.1,
    elements: 5,
    display: 3210,
    elementSpacing: 4,
    elementPadding: 2,
  },
)

const errorsLine = grid.set(0, 6, 4, 3, contrib.line, {
  style: {
    line: 'red',
    text: 'white',
github wechaty / wechaty-getting-started / examples / professional / blessed-twins-bot / bless-twins-bot.ts View on Github external
/*
 *
 * LCD Options
//these options need to be modified epending on the resulting positioning/size
  options.segmentWidth = options.segmentWidth || 0.06; // how wide are the segments in % so 50% = 0.5
  options.segmentInterval = options.segmentInterval || 0.11; // spacing between the segments in % so 50% = 0.5
  options.strokeWidth = options.strokeWidth || 0.11; // spacing between the segments in % so 50% = 0.5
//default display settings
  options.elements = options.elements || 3; // how many elements in the display. or how many characters can be displayed.
  options.display = options.display || 321; // what should be displayed before anything is set
  options.elementSpacing = options.spacing || 4; // spacing between each element
  options.elementPadding = options.padding || 2; // how far away from the edges to put the elements
//coloring
  options.color = options.color || "white";
*/
const lcdLineOne = grid.set(0, 9, 2, 3, contrib.lcd,
  {
    label: 'LCD Test',
    segmentWidth: 0.06,
    segmentInterval: 0.11,
    strokeWidth: 0.1,
    elements: 5,
    display: 3210,
    elementSpacing: 4,
    elementPadding: 2,
  },
)

const errorsLine = grid.set(0, 6, 4, 3, contrib.line, {
  style: {
    line: 'red',
    text: 'white',
github aws / aws-iot-device-sdk-js / examples / temperature-control / temperature-control.js View on Github external
//
   //   curState - Current state of heat transfer device
   //
   //              Type: Enum (heating|cooling|stopped)
   //              Units: N/A
   //              Read Only
   //
   var deviceMonitorState = {
      intTemp: 72,
      extTemp: 45,
      curState: 'stopped'
   };

   var networkEnabled = true;

   var lcd1 = grid.set(1, 1, 2, 3, contrib.lcd, {
      label: 'Setpoint',
      segmentWidth: 0.06,
      segmentInterval: 0.11,
      strokeWidth: 0.1,
      elements: 3,
      elementSpacing: 4,
      elementPadding: 2,
      color: 'green'

   });

   var lcd2 = grid.set(3, 1, 2, 3, contrib.lcd, {
      label: 'Interior',
      segmentWidth: 0.06,
      segmentInterval: 0.11,
      strokeWidth: 0.1,
github aws / aws-iot-device-sdk-js / examples / temperature-control / temperature-control.js View on Github external
var networkEnabled = true;

   var lcd1 = grid.set(1, 1, 2, 3, contrib.lcd, {
      label: 'Setpoint',
      segmentWidth: 0.06,
      segmentInterval: 0.11,
      strokeWidth: 0.1,
      elements: 3,
      elementSpacing: 4,
      elementPadding: 2,
      color: 'green'

   });

   var lcd2 = grid.set(3, 1, 2, 3, contrib.lcd, {
      label: 'Interior',
      segmentWidth: 0.06,
      segmentInterval: 0.11,
      strokeWidth: 0.1,
      elements: 3,
      elementSpacing: 4,
      elementPadding: 2,
      color: 'white'
   });

   var lcd3 = grid.set(5, 1, 2, 3, contrib.lcd, {
      label: 'Exterior',
      segmentWidth: 0.06,
      segmentInterval: 0.11,
      strokeWidth: 0.1,
      elements: 3,
github stevenpack / cryptowarrior / src / components / LivePriceComponent.js View on Github external
getWidgetOpts(opts) {
        return new Component_1.WidgetOpts(contrib.lcd, {
            label: this.ignoreTickerChange ? `Live (${this.tickerId})` : "Live",
            strokeWidth: 2,
            elements: 7,
            display: "0000.00",
        });
    }
    setWidget(widget) {
github stevenpack / cryptowarrior / src / components / BigLabelComponent.js View on Github external
getWidgetOpts(opts) {
        return new Component_1.WidgetOpts(contrib.lcd, {
            label: "",
            strokeWidth: 2,
            elements: 7,
            display: "------",
        });
    }
    setWidget(widget) {
github stevenpack / cryptowarrior / src / components / LivePriceComponent.ts View on Github external
public getWidgetOpts(opts?: any): WidgetOpts {
        return new WidgetOpts(contrib.lcd,
            {
                label: this.ignoreTickerChange ? `Live (${this.tickerId})` : "Live",
                strokeWidth: 2,
                elements: 7,
                display: "0000.00",
            });
    }
github stevenpack / cryptowarrior / src / components / BigLabelComponent.ts View on Github external
public getWidgetOpts(opts?: any): WidgetOpts {
        return new WidgetOpts(contrib.lcd,
            {
                label: "",
                strokeWidth: 2,
                elements: 7,
                display: "------",
            });
    }