Avatar for 7oo1er


Member since Mar 2018 • Last active Mar 2018
  • 3 conversations

Asseto Corsa home driver)

Most recent activity

  • in JavaScript
    Avatar for 7oo1er

    Thank you for support and all answers, I'm happy with it!

  • in JavaScript
    Avatar for 7oo1er


    As I read in Internets, array.length can cut array to size. I need this to save only 100 last readings. But using lenght can, I think, cause some memory issues.

    a = new Array();
    a = [1, 2, 3, 4, 5, 6];

    console requests:

    >[ 1, 2, 3, 4, 5, 6 ]
    =[ 1, 2, 3, 4, 5, 6 ]
    >a.length = 2
    =[ 1, 2, 3, 4, 5, 6, "length": 2 ]

    I can get a real array size only before trying to cut it.

  • in Pico / Wifi / Original Espruino
    Avatar for 7oo1er

    Need to kill any console messages that appear after Serial is open with a terminal app. I reconnect Pico before opening Serial with PuTTY evry time. Used Troubleshooting code, but it works halfway. I need to get "B01" and "B02" messages only, but some errors happened.

    function onInit() {
      setTimeout(function() { Serial1.setConsole(); }, 1000);
      digitalWrite(LED2, 0);
    var on = true;
    function echoOut(indelay) {
      if (indelay < 1){
      } else if (indelay > 1 && indelay < 3) {
      } else if (indelay > 3) {
        digitalWrite(LED2, 1); // it's ON after power on, so need to put OFF in init
        USB.print("move to USB\r\n"); //this stops LED blink if USB Serial is not connected
        console.log("console is moved");
    setInterval(function () {
      on = !on;
      LED1.write(on); // Just to check Pico is alive
    }, 500);
    setWatch(function (e) {echoOut(e.time-e.lastTime);},
      BTN1, { repeat:true,

    short: B01

    longer: B02


    <- Serial1
    Uncaught InternalError: setDeviceClockCmd: Unknown Device 752
     at line 31 col 20
    in function "echoOut" called from line 1 col 26
    in function called from system

    Same errors "Unknown Device" I got with and LoopbackA too. Second longest press in same session makes no error, just output "move to USB" and second message.
    So, I got a clean output, and move back to USB is working. But I want to point all that errors.

  • Avatar for 7oo1er


    I did some tests with Keyboard HID sample code, it works with Virtual Com Port at the same time under Windows 10.

    But under Windows 7 I see it as:

    1. VCP with no working Keyboard emulation.
    2. Working Keyboard emulation (after deleting VCP ST driver) with no VCP and IDE connection.

    Yes, I read all in search about this HID USB in this forum, but still can't be sure about, can't figure it out clearly.

    1. Is it possible to avoid VCP driver without it's uninstall? Can't make it work with:

      function onInit(){
      setWatch(function(){ USB.setConsole();}, BTN, true);

      Must this make Pico to be recognized as a Keyboard with sample code?

    2. Ok, looks like Windows 10 works in both ways: income as a USB keyboard and possible feedback to device LEDs with a Com port connection. How this can be done in any other way, to support Windows 7 or make a proper connection? How any feedback is possible?

    My main target is a custom joystick with LEDs. I Imagine this as a USB HID Joystick and a small app to listen target application and manage device LEDs.