Avatar for phil303

phil303

Member since Sep 2017 • Last active Aug 2018
  • 2 conversations
  • 4 comments

Most recent activity

  • in JavaScript
    Avatar for phil303

    Ah that's a bummer. Been doing web dev and assumed things worked in a similar fashion. I think I was imagining something coming along, reading the requires ahead of time, and compiling everything into a single block of source code a la webpack.

    Sounds like I can just keep it in source control but save it to flash separately. Thanks for the explanation!

  • in JavaScript
    Avatar for phil303

    Hi,
    I took a gander at the source code here. And while I'm not amazing at reading C, I can read comments. It looks like currently there's no way to load a file that is co-located within the same folder.

    I have a project that has a bunch of other stuff besides the Espruino code so I'm trying to avoid using the Espruino playground folder since that wouldn't be under the same source control. For more context, my project directory structure is:

    /project_root
      LEDServer.js
      warningGif.js
      ... other non-espruino stuff ...
    

    LEDserver.js is basically a server that understands some animation binary data from a request. warningGif.js is a file with a pre-built animation I'd like to load when things go awry, like one of the incoming frames eating up too much current. It doesn't seem like this is possible in the current setup.

    I even tried hacking this a bit, allowing NPM in the Web IDE settings, and using a node_modules folder to house warningGif.js but alas, this refuses to upload to the device (an ESP32).

    I'm not sure I'd be able to do it but I wouldn't mind trying. If I pulled together some C code to look up a file locally and made a PR, would that be something folks would be interested in? Is there some technical reason you can't do this?

  • in ESP32
    Avatar for phil303

    Woke up this morning and almost immediately noticed that I had forgotten to ground the level shifter. D'oh.

    This is working perfectly now! It's very fun to play with.

  • in ESP32
    Avatar for phil303

    Hi all,
    I'm really new to the ESP32 world and hardware programming in general. I have a problem I'm not sure where to begin to diagnose. I can't seem to get my IO pin to listen.

    My set up looks pretty similar to the following:

    Except instead of the Huzzah board I have a DevKitC board (this was the closest thing I could find for Fritzing) and I'm actually connecting the data out from the DevKitC board on IO14. Additionally, for now I'm just powering the board via USB (so remove the voltage regulator section from the mix).

    My script to power just two leds is pretty simple:

    const neopixel = require('neopixel');
    
    var strip = new Uint8ClampedArray([
      0x0, 0x0, 0xff,
      0x0, 0x0, 0x0,
    ]);
    neopixel.write(D14, strip);
    

    Sometimes it doesn't react when I upload this. Or if it does, it's seemingly at random. On consecutive uploads, different leds will light up as different colors. Just on a whim, I tried to move the data lead to other IO pins and those seem to have different colors that light up which I wasn't expecting. One other weird thing I noticed, is if I try a script like this:

    var rgb = new Uint8ClampedArray(2*3);
    var pos = 0;
    function getPattern() {
      pos++;
      for (var i=0;i<rgb.length;) {
        rgb[i++] = (1 + Math.sin((i+pos)*0.1324)) * 127;
        rgb[i++] = (1 + Math.sin((i+pos)*0.1654)) * 127;
        rgb[i++] = (1 + Math.sin((i+pos)*0.1)) * 127;
      }
      return rgb;
    }
    setInterval(function() {
      require("neopixel").write(D14, getPattern());
    }, 100);
    

    This actually does seem to flash lots of colors. So it's getting some input somehow.

    Any help on this is much appreciated. I'm not even sure how to start diagnosing the issue.

Actions