Avatar for jeffmer


Member since Apr 2020 • Last active May 2023
  • 11 conversations

Most recent activity

  • in Other Boards
    Avatar for jeffmer

    Hi, Gordon rightly thought that switching between HW and SW SPI was a bit of a hack and that a more elegant solution would be to see if SPIFLASH code could use HW SPI when sharing SPI was necessary . I did not get round to looking at that and as @fanoush mentions, the HW/SW hack is not in the main Espruino repository.

  • in Bangle.js
    Avatar for jeffmer

    I think it would be a nice extension to consider tag groups as folder icons in the the desktop metaphor as you suggest. Entirely up to you as to which app you base it on.

  • in Projects
    Avatar for jeffmer

    Yet another radio running Espruino, this one is also based on an ESp32 controlling the SI4732 radio ic. It has a ST7789V tft display with no touch screen so everything is controlled by the rotary controller.


  • in Puck.js, Pixl.js and MDBT42
    Avatar for jeffmer

    In developing the Rotary Encoder as mouse wheel, I tested the Espruino mouse example with the latest 2v15 release for Puck.js. It worked with no problem on Linux and IOS although I had to clear out some old pairing data by doing a complete reset of the Puck.

  • in Projects
    Avatar for jeffmer

    Very happy for you to put it on Espruino.com as an example - I would be honoured!

  • in Projects
    Avatar for jeffmer

    Thats very neat -will it be fast enough to use for loading code into flash?

  • in Projects
    Avatar for jeffmer

    This project was driven by the inconvenience of using SDR (Software Defined Radio) programs without having an explicit physical tuning knob to adjust frequency. Subsequently, I have found it also useful for scrolling with tablets.

    The implementation uses an Espruino Puck.js and a rotary encoder as shown below in the breadboard prototype and the final device.

    Connections are (Encoder -> Puck): GND -> GND, SW -> D28, ENCODER -> D29,D30.

    The program below presents the Rotary Encoder as the middle wheel and button of a bluetooth mouse.

    function createEncoder(pinA,pinB){
      var a0=pinA.read(), c0=pinB.read(), incr0 =0, second=false;
      var OBJ = {};
      function handler () {
        var a = pinA.read();
        var b = pinB.read();
        if (a != a0) {              // A changed
          a0 = a;
          if (b != c0) {
            c0 = b;
            var incr = (a == b)?1:-1;
            if (incr!=incr0 || !second) OBJ.emit("change",incr);
            incr0=incr; second = !second;
      return OBJ;
    function createSwitch(pinA){
      var OBJ = {};
      function handler(ns){
      return OBJ;
    //HID report for Mouse device
    var report = new Uint8Array([
      0x05, 0x01, 0x09, 0x02, 0xA1, 0x01,
      0x09, 0x01, 0xA1, 0x00, 0x05, 0x09,
      0x19, 0x01, 0x29, 0x03, 0x15, 0x00,
      0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
      0x81, 0x02, 0x95, 0x01, 0x75, 0x05,
      0x81, 0x01, 0x05, 0x01, 0x09, 0x30,
      0x09, 0x31, 0x09, 0x38, 0x15, 0x81, 
      0x25, 0x7F, 0x75, 0x08, 0x95, 0x03,   
      0x81, 0x06, 0xC0, 0x09, 0x3c, 0x05,
      0xff, 0x09, 0x01, 0x15, 0x00, 0x25,
      0x01, 0x75, 0x01, 0x95, 0x02, 0xb1,
      0x22, 0x75, 0x06, 0x95, 0x01, 0xb1,
      0x01,   0xc0 ]
    NRF.setServices(undefined, { hid :report });
    var ROT = createEncoder(D29,D30);
    var SW = createSwitch(D28);

    The encoder handler is adapted from here and I found it worked much more reliably than the Espruino encoder module. In addition the following code allows the device to switch from HID to normal Espruino mode for connection to the WebIDE i.e. hold down the encoder switch until the Puck flashes GREEN. On reboot or reset, it will go into HID mode by default and flash BLUE. On connection, there is a BlUE flash and a RED flash on disconnection.

      if(D28.read()) E.kickWatchdog();
    E.enableWatchdog(10, false);
    function flash(pin){
    function delayms(d) {
        var t = getTime()+d/1000; 
    var STOR = require("Storage");
    if (D28.read()){
      if (STOR.read("main.js")) eval(STOR.read("main.js"));
    } else {