You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yes, it can be zero - it's just whether buttons are pressed or not. I'll put definitions in the modules, but it's 1=left, 2=right, 4=middle - a bit like dealing with low-level GUI events tends to be :)

    I think at some point the modules will need a bit of tidying - for instance making sure you can actually print a line of text to the Keyboard.

    As a fun aside, you can now do something like this:

    var kb = require("USBKeyboard");
    
    var data = [];
    
    setInterval(function() {
      if (data.length>=40) data = data.slice(-39);
      data.push(E.getTemperature());
    }, 1000);
    
    function outputData() {
      var i = 0;
      function outputLine() {
        if (i>=data.length) return;
        var s = data[i++].toFixed(2)+",\n";
        kb.type(s, outputLine);
      }
      outputLine();
    }
    
    setWatch(outputData, BTN, {debounce:100,repeat:true, edge:"rising"});
    

    I'll post a link to the latest version in a bit

About

Avatar for Gordon @Gordon started