Avatar for JumJum

JumJum

Member since Oct 2013 • Last active Dec 2019
  • 132 conversations
  • 663 comments

Most recent activity

  • in Bangle.js
    Avatar for JumJum

    A guy from Heise wrote about first experiences.
    https://www.heise.de/make/artikel/Auspro­biert-Javascript-fuers-Handgelenk-mit-de­r-Smartwatch-Bangle-js-4597599.html
    Good and helpful article. Sorry, its in german only.

    Frustrating are the comments.
    Most of them read the word Javascript and switch their brain to deepSleep.
    In this mode they still have the power to tell the world their "facts"

    • its not C, will never work
    • JS needs MB of RAM, anything else is impossible
    • it will be horrible slow
    • JS eats power like crazy
    • etc. etc.
      As mentioned above, its frustrating
  • in Bangle.js
    Avatar for JumJum

    Its an early state for questions like this, anyway lets start to be prepared once we get bangle.js
    Gesture event gives some xyzxyz....xyz info. Hard to recognize gestures based on that.
    AFAIK bangle needs tflite and tfname files to recognize gestures, which are then given in aiGesture event.

    If I'm not on the wrong train:
    Will there be a standard file set, for example with gestures from kickstarter video ?
    How could we create our own gestures, for example drawing an horizontal/vertical circle in the air?
    Will we have something like a gesture library, so we could create special sets of gestures for an app ?

  • in Projects
    Avatar for JumJum

    Software with some demos, including some special commands for high speed.

    require("Font8x16").add(Graphics);
    require("Font6x8").add(Graphics);
    
    function Led64x32(){
      var me = this;
      var Pen;  //pin Enable
      var sfnc,dfnc;  // bound functions to shift data and set address
      var ledBuf;//graphics.buffer for LED
      var arr; //array of drawing functions
      var boardDur; //refresh time for panel in mS
      var tmr; //interval timer for refresh 
      me.init = function(board){
        switch(board){
          case "ESP32":
            initPins(D2,D16,D4,D17,D15,D27, D5,D18,D19,D21, D26,D22,D25);
            boarDur = 20;
            break;
          case "Espruino":
            initPins(B3,B5,B4,B6,C11,C10,B7,C9,B8,C8­,C6,B9,C12);
            boardDur = 10;
            break;
          default: console.log(board + " not supported (yet?)");
        }
        return initGraphic();
      };
      me.stop = function(){if(tmr) clearInterval(tmr);};
      function initPins(R1,R2,B1,B2,G1,G2,A,B,C,D,Latch­,Clock,Enable){
        Pen = Enable;
        sfnc = shiftOut.bind(null,[R2,G2,B2,undefined,R­1,G1,B1],{clk:Clock});
        dfnc = digitalWrite.bind(null,[Enable,Latch,Lat­ch,D,C,B,A,Enable]);
      }
      function initGraphic(){
        gr = Graphics.createArrayBuffer(64,32,4,{inte­rleavex:true});
        ledBuf = gr.buffer;
        createFuncArr();
        return gr;
      }
      function createFuncArr(){
        arr = [];
        arr.push({callback:Pen.reset.bind(Pen)})­;
        for(i = 0; i < 16; i++){
          arr.push(new Uint8Array(ledBuf,i*64,64));
          arr.push({callback:dfnc.bind(null,33|i<<­1)});
        }
        arr.push({callback:Pen.set.bind(Pen)});
      }
      me.start = function(){
        tmr = setInterval(function(){
          sfnc(arr);
        },boardDur);
      };
      me.frame = function(c){
        me.clear();
        if(!c) c = 7;
        grf.setColor(c);
        grf.drawRect(0,0,63,31);
        grf.drawRect(1,1,62,30);
      };
      me.clear = function(c){
        clearInterval();
        grf.setBgColor(0);
        grf.clear();
      };
    }
    var lf = new Led64x32();
    var grf = lf.init("Espruino");
    //Some demos
    function color(col){
      clearInterval();
      if(!col) col = 0;
      grf.setBgColor(col);
      grf.clear();
      lf.start();
    }
    function graph(){
      clearInterval();
      var barh = 5;
      grf.setBgColor(6);
      grf.clear();
      grf.setColor(2);
      grf.fillRect(5,12,50,25);
      grf.setColor(4);
      grf.fillRect(10,14,40,20);
      grf.fillRect(10,0,40,0);
      grf.setColor(7);
      grf.drawRect(0,31,5,5);
      lf.start();
      setInterval(function(){
        barh++; if(barh>24) barh = 1;
        grf.setColor(0);
        grf.fillRect(1,30,4,6);
        grf.setColor(1);
        grf.fillRect(1,30,4,30 - barh);
      },200);
    }
    function xmas(){
      var pnt = 0;
      var px = [[10,10],[25,20],[30,15],[40,14]];
      function flicker(){
        grf.setPixel(px[pnt][0],px[pnt][1],2);
        pnt++;if(pnt>3)pnt = 0;
        grf.setPixel(px[pnt][0],px[pnt][1],7);
      }
      lf.frame(7);
      grf.setColor(2);
      grf.fillPoly([1,1,1,31,30,16,1,1]);
      grf.fillPoly([15,3,15,28,40,16,15,3]);
      grf.fillPoly([28,6,28,25,50,16,28,6]);
      grf.setColor(7);
      grf.drawLine(6,2,8,2);
      grf.drawLine(6,30,8,30);
      lf.start();
      setInterval(function(){flicker();},300);­
    }
    function txt(t,c){
      if(!t) t = "Open";
      if(!c) c = 2;
      var cbg = 7;
      lf.frame(cbg);
      grf.setColor(cbg);
      grf.drawEllipse(2,2,62,30);
      grf.setFont8x16();
      grf.setColor(c);
      grf.drawString(t,36 - grf.stringWidth(t) / 2,7);
      lf.start();
      setInterval(function(){
        cbg--;if(cbg<1) cbg=7;
        grf.setColor(cbg);grf.drawEllipse(2,2,62­,30);
        grf.setColor(8 - cbg);
        grf.drawString(t,36 - grf.stringWidth(t) / 2,7);
      },500);
    }
    function magic(){
      var col = 1;radius = 15;
      clearInterval();
      grf.setBgColor(0);
      grf.clear();
      lf.start();
      setInterval(function(){
        col++;
        if(col>7) col = 1;
        radius--;
        if(radius < 3){
          radius = 15;
          grf.setColor(0);
          grf.fillCircle(30,15,15);
        }
        grf.setColor(col);
        grf.fillCircle(30,15,radius);
      },100);
    }
    function mondrinator(){
      var rndCol = function(){ return Math.random() * 6;};
      var rndBorder = function(){ return 1 + Math.random() * 7;};
      var rndRect = function(){ return Math.random() * 4;};
      clearInterval();
      lf.start();
      function showNext(){
        var right,left,top,bottom,rectId;
        grf.setBgColor(7);grf.clear();
        grf.setColor(rndCol());left = rndBorder();grf.drawLine(left,0,left,31)­;
        grf.setColor(rndCol());right = rndBorder();grf.drawLine(63-right,0,63-r­ight,31);
        grf.setColor(rndCol());top = rndBorder();grf.drawLine(0,top,63,top);
        grf.setColor(rndCol());bottom = rndBorder();grf.drawLine(0,31-bottom,63,­31-bottom);
        rectId = parseInt(rndRect());grf.setColor(rndCol(­));
        switch(rectId){
          case 0: grf.fillRect(0,0,left - 1,top - 1);break;
          case 1: grf.fillRect(64-right,0,63,top - 1);break;
          case 2: grf.fillRect(0,32 - bottom,left-1,31);break;
          case 3: grf.fillRect(64-right,31,63,32 - bottom);break;
        }
        setTimeout(function(){showNext();},2000)­;
      }
      setTimeout(function(){showNext();},2000)­;
    }
    function pie(){
      var i,last;
      lf.clear();
      last = 0;
      centerX = 45; centerY = 16;
      var data = [[20,1,"Apple"],[30,2,"Beef"],[40,4,"Bee­r"],[10,6,"Pills"]];
      function drawPie(pnt){
        grf.setColor(7);
        grf.drawLine(0,0,0,31);
        grf.drawLine(1,0,1,31);
        var i,dt = data[pnt];
        var polyData = [centerX,centerY];
        var s = Math.PI * last / 100;
        var x = centerX + Math.round(Math.cos(s) * 15);
        var y = centerY + Math.round(Math.sin(s) * 15);
        polyData.push(x); polyData.push(y);
        for(i = 0; i < 10; i++){
          last += dt[0] / 10;
          s = Math.PI * (last + dt[0] / 10 * i) / 100;
          x = centerX + Math.round(Math.cos(s) * 15);
          y = centerY + Math.round(Math.sin(s) * 15);
          polyData.push(x);polyData.push(y);
        }
        last += dt[0];
        grf.setColor(dt[1]);
        grf.fillPoly(polyData,true);
      }
      function drawText(pnt){
        var dt = data[pnt];
        grf.setFont6x8();
        grf.setColor(dt[1]);
        grf.drawString(dt[2],4,pnt * 8);
      }
      for(i = 0; i < data.length;i++){
        drawPie(i);
        drawText(i);
      }
      lf.start();
    }
    
  • in Projects
    Avatar for JumJum

    About a year ago, Gordon added some functions to support Led panel with 64x32 color pixel.
    At that time, I got it running on an ESP32.
    Some days ago this came back to my fingers, and I tried to get it running with one of the first Espruino boards.
    Big surprise, these older boards are much faster than the ESP32. To make it more visible, some lines are witten and the result is what you see in attached images showing a P5 board.

    • 2 comments
    • 118 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for JumJum

    My knowledge about TensorFlow (see Bangle.js) is close to 0. Before I invest time in that, I would like to get an idea from the expert whether my idea would be possible at all.
    Could we implement tensor flow for the MDBT42Q board to get speech recognition?
    For the beginning 18 words from standard (18w) would be fine. If we could have or train an additional start word (like Gordon or Espruino for example), life could be wonderful.

  • in News
    Avatar for JumJum

    Goal reached, not even 5 hours after start.
    Big waiting for delivery in March starts now.
    Just comes to my mind, my birthday, end of march, hmm ... ;-))

Actions