Navigation

    obniz Developer's Community Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. nbykosw
    N
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    nbykosw

    @nbykosw

    0
    Reputation
    5
    Posts
    128
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    nbykosw Follow

    Best posts made by nbykosw

    This user hasn't posted anything yet.

    Latest posts made by nbykosw

    • RE: マトリクスLEDの8列目が1列目に表示されてしまう

      パーツライブラリのドット単位で転送させるところの説明で、  matrix.draw(dots); を使うことになっていますが、これを  matrix.dots(dots); に変えてみていただけませんか。 小生作成の、サンプルプログラムを下記しますので参考になれば幸いです。

      <html>
      <head>
      <script src="https://unpkg.com/obniz@3.5.0/obniz.js"></script>
      </head>
      <body>
      <div id="Keyestudio_HT16K33"></div>
      <script>
      var obniz = new Obniz("OBNIZ_ID_HERE");
      obniz.onconnect = async function () {
      const matrix = obniz.wired("Keyestudio_HT16K33", { gnd:0, vcc:1, sda:2, scl:3 });
      matrix.init(8);
      matrix.brightness(7);
      const ctx = obniz.util.createCanvasContext(matrix.width, matrix.height);

      var dots = new Array(9);
      dots = [1,2,4,8,16,32,64,128,0];

      obniz.repeat(async function(){
      ctx.fillStyle = "black";
      ctx.fillRect(0, 0, matrix.width, matrix.height);
      ctx.fillStyle = "white";

        while(true){ 
          for(i=0; i<8; i++){
            matrix.dots(dots);
            await obniz.wait(200);
            dots[8] = dots[0];
            for(j= 0; j<8; j++){
              dots[j] = dots[j+1];
              }
            }
          }
        }, 1000/10);
      

      }
      </script>
      </body>
      </html>

      posted in Beginner Questions/Discussion
      N
      nbykosw
    • RE: Obniz Starter Kit の LEDマトリクス のプログラム

      教えていただいたプログラムで動作確認しました。 ありがとうございました。 自分のプログラムではどこが悪かったのかはこれから比較して検討します。 ところで、自分が購入したキットでは、VCCとGNDのピン位置が入れ替わっています。 プログラム上で変更すればいいことですが、メーカさんで仕様変更があったのでしょうか?

      posted in Beginner Questions/Discussion
      N
      nbykosw
    • RE: マトリクスLEDの8列目が1列目に表示されてしまう

      @うぞう said in マトリクスLEDの8列目が1列目に表示されてしまう:

      Obniz Starter Kit付属のマトリクスLED

      3つ前に投稿しているものです。 Obniz Starter Kit付属のマトリクスLEDでの表示に関する類似の不具合と思います。 このキットを、A*****では一文字ずつ表示したり、一列ずつ横に流していくことができるので、ObnizのCanvasContextの問題ではないでしょうか?

      posted in Beginner Questions/Discussion
      N
      nbykosw
    • RE: Obniz Starter Kit の LEDマトリクス のプログラム

      @nbykosw said in Obniz Starter Kit の LEDマトリクス のプログラム:

      なお、以下のプログラムを走らせると、初めの”H”と次の”e”の1列目を表示して止まります。

      <html>
      <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <script src="https://obniz.io/js/jquery-3.2.1.min.js"></script>
      <script src="https://unpkg.com/obniz@3.5.0/obniz.js"></script>
      </head>
      <body>
      <div id="Keyestudio_HT16K33"></div>
      <script>
      var obniz = new Obniz("OBNIZ_ID_HERE");
      obniz.onconnect = async function () {
      const matrix = obniz.wired("Keyestudio_HT16K33", { gnd:0, vcc:1, sda:2, scl:3 });
      matrix.init(8);
      matrix.brightness(7);

      const ctx = obniz.util.createCanvasContext(matrix.width, matrix.height);
      ctx.fillStyle = "black";
      ctx.fillRect(0, 0, matrix.width, matrix.height);
      ctx.fillStyle = "white";
      ctx.font = "9px sans-serif";
      ctx.fillText('Hello World', 0, 7);

      matrix.draw(ctx);

      }
      </script>
      </body>
      </html>

      posted in Beginner Questions/Discussion
      N
      nbykosw
    • Obniz Starter Kit の LEDマトリクス のプログラム

      Obniz Starter Kit を購入し、パーツを接続する を見ながらプログラムを楽しんでいますが、LEDマトリクスに関しては、パーツライブラリの説明では、動作させることができません。

      例えば、
       Hello World をHから一つずつ順番に表示させる
       ドット単位で表示させる

      といった動作をするプログラムはどこかに公開されていないでしょうか?

      posted in Beginner Questions/Discussion
      N
      nbykosw