0

我正在尝试让我的液晶显示器关闭背光灯并再次打开。

打开它的命令:lcd.noBacklight();工作正常,但我不知道如何再次打开它。

var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {

  var lcd = new five.LCD({
    controller: "PCF8574T"
  });

  lcd.cursor(0, 0).print("1 Hello Teste");
  lcd.cursor(1, 0).print("2 Hello Teste");
  lcd.cursor(2, 0).print("3 Hello Teste");
  lcd.cursor(3, 0).print("4 Hello Teste");

  lcd.noBacklight();

  setTimeout(() => {
    lcd.yesBacklight(); //Here I don't know what to do
  }, 1500);

  setInterval(() => {
    lcd.noBacklight();
  }, 1500);


});

我怎么能重新打开它?

4

1 回答 1

0

好的,只需lcd.backlight();输入小写即可解决。

var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
  var i = 0;
  var lcd = new five.LCD({
    controller: "PCF8574T"
  });

  lcd.cursor(0, 0).print("1 Hello Teste");
  lcd.cursor(1, 0).print("2 Hello Teste");
  lcd.cursor(2, 0).print("3 Hello Teste");
  lcd.cursor(3, 0).print("4 Hello Teste");

  setInterval(() => {
    lcd.clear();
    lcd.noBacklight();
    lcd.cursor(0, 0).print(i + " Hello Teste");
    i++;
    lcd.backlight();
  }, 1500);


});
于 2017-05-02T00:31:22.787 回答