Avatar for Frida

Frida

Member since Sep 2013 • Last active Dec 2017
  • 18 conversations
  • 143 comments

Most recent activity

  • in Interfacing
    Avatar for Frida

    Hi! I have changed getInt16 () and getUint16 (xx, true), according to Doc

    function DataView.getUint16 (byteOffset, littleEndian)
    byteOffset - The offset in bytes to read from
    littleEndian - (optional) Whether to read in little endian - if false or undefined data is read as big endian
    
    

    So now, temperature, pressure and humidity show the same as my Ruuvitag.
    Gas resistance is very high so I do not know if it is correct! 12,535,991.64395217411.
    If I try with upython on a Wipy, the number is negative.
    The next thing I want to try is on a RaspberryPi.

    BME680.prototype.get_calib_data = function() {
      var coefs = new Uint8Array(C.COEFF_ADDR1_LEN+C.COEFF_ADD­R2_LEN);
      coefs.set(this.r(C.COEFF_ADDR1,C.COEFF_A­DDR1_LEN));
      coefs.set(this.r(C.COEFF_ADDR2,C.COEFF_A­DDR2_LEN),C.COEFF_ADDR1_LEN);
      var vc = new DataView(coefs.buffer);
      // everything is little endian
      this.cal={};
      /* Temperature related coefficients */
      this.cal.par_t = [,vc.getUint16(C.T1_LSB_REG, true) // PB
                        ,vc.getInt16(C.T2_LSB_REG, true)  // PB
                        ,vc.getInt8(C.T3_REG)];
    
      /* Pressure related coefficients */
      this.cal.par_p = [,vc.getUint16(C.P1_LSB_REG, true) // PB
                        ,vc.getInt16(C.P2_LSB_REG, true) // PB
                        ,vc.getInt8(C.P3_REG)
                        ,vc.getInt16(C.P4_LSB_REG, true) // PB
                        ,vc.getInt16(C.P5_LSB_REG, true) // PB
                        ,vc.getInt8(C.P6_REG)
                        ,vc.getInt8(C.P7_REG)
                        ,vc.getInt16(C.P8_LSB_REG, true) // PB
                        ,vc.getInt16(C.P9_LSB_REG, true) // PB
                        ,vc.getUint8(C.P10_REG)];
    
      /* Humidity related coefficients */
      this.cal.par_h = [,(vc.getUint8(C.H1_MSB_REG) << C.HUM_REG_SHIFT_VAL) |
                         (vc.getUint8(C.H1_LSB_REG) & C.BIT_H1_DATA_MSK)
                        ,(vc.getUint8(C.H2_MSB_REG) << C.HUM_REG_SHIFT_VAL) |
                         (vc.getUint8(C.H2_LSB_REG) >> C.HUM_REG_SHIFT_VAL)
                        ,vc.getInt8(C.H3_REG)
                        ,vc.getInt8(C.H4_REG)
                        ,vc.getInt8(C.H5_REG)
                        ,vc.getUint8(C.H6_REG)
                        ,vc.getInt8(C.H7_REG)];
    
      /* Gas heater related coefficients */
      this.cal.par_gh = [,vc.getInt8(C.GH1_REG)
                        ,vc.getInt16(C.GH2_LSB_REG, true) // PB
                        ,vc.getInt8(C.GH3_REG)];
      /* Other coefficients */  
      this.cal.res_heat_range = (this.r(C.ADDR_RES_HEAT_RANGE_ADDR,1)[0]­&C.RHRANGE_MSK)/16;
      this.cal.res_heat_val = this.r(C.ADDR_RES_HEAT_VAL_ADDR,1)[0];
      this.cal.range_sw_err = (this.r(C.ADDR_RANGE_SW_ERR_ADDR,1)[0]&C­.RSERROR_MSK)/16;
    };
    
    
  • in Puck.js
    Avatar for Frida

    In left pane type reset() then save(), it will clear the saved program.

  • in General
    Avatar for Frida

    100.00 USD is on the way.

  • in Puck.js
    Avatar for Frida

    I have no problems with the Huawei P10 lite.

  • in Projects
    Avatar for Frida

    run this in own folder:
    git clone --recursive https://github.com/espruino/EspruinoWebI­DE.git

    then you get a copy, double or 3 duble this folder or more.

    in chrome://extensions/
    do "Load unpacked extension" from your copyes

    then in:
    chrome://apps/
    you have

  • in Projects
    Avatar for Frida

    Is it so you like it?

  • in Puck.js
  • in Puck.js
    Avatar for Frida

    Is it somthing like this.
    I made this on my Puck to get ruuvi tags and display the results.
    The ruuvi tags are emitting raw values in "Manufacturer specific data".

    // pucktest05
    
    setBusyIndicator(LED1);
    var darray = {};
    var tg = 0x2F; // 0x2F ^ 0x73 = 0x5C
    var count = 0;
    
    
    function getDewpoint(temp, humi) {
    
      var C = {
        a1 : 8.1332,
        b1 : 1762.39,
        c1 : 235.66
      };
    
      PP = Math.pow(10,C.a1 - C.b1 / (this.temp + C.c1));
      this.dewp = -((C.b1 / (Math.log(this.humi * PP / 100) / Math.log(10) - C.a1)) + C.c1);
      return this.dewp.toFixed(2);
    }
    
    function bprint(dada, navn) {
      humi = dada.data[8] / 2;
      temp = dada.data[9] + dada.data[10] / 100;
      if(temp >128) {temp = 128 - temp;}
      bati = (dada.data[19] * 256 + dada.data[20]);
      dewi = getDewpoint(temp, humi);
      console.log(navn +
                  dada.rssi +
                 '  ' + temp.toFixed(2) +
                 '  ' + humi.toFixed(1) +
                 '  ' + dewi +
                 '  ' + bati);
    }
    
    function cprint(didi) {
      tg ^= 0x73;
      console.log('count: ' + count++);
      console.log(String.fromCharCode(tg) +
                     ' ' + NRF.getBattery().toFixed(3));
      console.log('   Sted  Rssi  Temp  Humi   Dewi  Bati');
      bprint(didi[0], '    Ude: ');
      bprint(didi[1], 'Drivhus: ');
      bprint(didi[2], '    Bad: ');
      bprint(didi[3], 'Udestue: ');
      console.log(' ');
    }
    
    function find() {
      NRF.findDevices(function(devices) {
        console.log(devices.length);
        for(i=0;i<devices.length;i++) {
          if(devices[i].id == 'ce:5c:55:08:22:5a random') {
            darray[0] = devices[i];
          }
          if(devices[i].id == 'da:dc:f2:19:d4:e3 random') {
            darray[1] = devices[i];
          }
          if(devices[i].id == 'fa:2e:7b:6d:97:e0 random') {
            darray[2] = devices[i];
          }
          if(devices[i].id == 'fc:62:2d:b7:96:30 random') {
            darray[3] = devices[i];
          }
        }
        cprint(darray);
      }, 3000);
    }
    
    find();
    setInterval(function () {
      find();
    }, 60000);
    
    
    
  • in General
    Avatar for Frida

    I've made a donation for 10 ESP8266-01, from my kickstarter set . 4$ per stk.

    • a little extra for your baby.

Actions