• Had time to try the mouse driver today. Here's the code:

    //mymouse.js
    // 15 Nov 2017
    //
    // Use pushbutton on pin B3 to reset
    // Loads mouse driver into the USB boot
    // Every second move mouse cursor by 20 pixels
    // in a square pattern
    //
    //load and save the program
    // unplug and replug the Pico USB
    // mouse cursor should be moving in square pattern
    // reconnect to WebIde
    // mouse cursor still moving
    // Type reset() in left  pane of WebIde
    // Type save() in left pane of WebIde
    
    
    var mouse = require("USBMouse");
    
    // A way back to normal just in case
    var but1=B3;
    setWatch(function(){
      console.log("endit");
      reset();
    },but1, {debounce:100,repeat:true, edge:"falling"});
    
    var i=0;
    setInterval(function () {
    //console.log(i);
      switch (i){
        case 0:
          mouse.send(0, 20, mouse.BUTTONS.NONE); // X movement, Y movement,
        break;
        case 1:
          mouse.send(20, 0, mouse.BUTTONS.NONE); // X movement, Y movement,
        break;
        case 2:
          mouse.send(0, -20, mouse.BUTTONS.NONE); // X movement, Y movement,
        break;
        case 3:
          mouse.send(-20, 0, mouse.BUTTONS.NONE); // X movement, Y movement,
        break;
      }
      i++;
      if( i>3) i=0;
    }, 1000);
    

    It's interesting that the WebIde still talks through the USB port with the mouse functions.

About