2025年5月7日水曜日

Johnny5-uno/raspi(tm1637:raspi,lcd-i2c:uno)

https://github.com/revolunet/tm1637を改変して成功 

sudo pigpiod で失敗したらhttps://wakky.tech/pigpio-initinitialise-compile-error/で

pidを切って再度起動するのが重要 なお以下のコードはsudo node tm1637-demo.js

-------- raspiだけどvcc 5v for tm1367 --------------------------------------------------

const { Board } = require("johnny-five");

const Raspi = require('raspi-io').RaspiIO;

const tm1637 = require('tm1637');


const board = new Board({

  io: new Raspi()

});


board.on("ready", () => {

  const display = tm1637({

    clk: "GPIO21",

    dio: "GPIO20",

    board: board

  })


  display.show("3.142");


  board.repl.inject({

    display

  });

});

----------------------------lcd1602----------------------------

const { Board, LCD } = require("johnny-five");
const board = new Board();

board.on("ready", () => {
  const lcd = new LCD({
    controller: "PCF8574" // ここがポイント
  });

  lcd.print("Hello, Johnny-Five!");
});


0 件のコメント:

コメントを投稿