Avatar for oesterle


Member since Nov 2014 • Last active Mar 2017
  • 4 conversations

Creative Technologist, based in the San Francisco Bay Area, open to travel

Connect with me on LinkedIn
Follow me on Twitter

Most recent activity

  • in JavaScript
    Avatar for oesterle

    Wow. OK, then! Sorta cool when you code something up, and it runs on someone else's hardware the first time. Cheers, @countxerox.

  • in Projects
    Avatar for oesterle

    I just got a chance to try this - looks nice!

    Thanks for taking a look, @Gordon!

    I guess for something pre-installed, people won't actually see any of the text that appears (initially) - and when they get to that point they could easily have loaded up your code themselves.

    True that. Still, it's nice to see something more than that red flash on battery insertion.

    (just an aside, but if I added espruino.com/ide/#code_url_h­ere it could be really helpful for posting up code?)

    I'm not sure what you mean.

    So I'm wondering what we could do 'out of the box' - when you first insert the battery and do nothing else - that would be fun, and that didn't drain the battery for those that turn the Puck on and then just leave it (including if they put it in a bag and the button kept being pressed).

    I do put a lot of stuff to sleep after 20 seconds right now, until the next button press. Maybe I could be smarter about detecting unintentional button presses. Hmm.

    The rainbow is nice, and maybe it could detect rotation using the magnetometer.

    YES. I'm totally thinking along the lines of making it more playful before connecting to an IDE. I'm going to fork this, and make something more of a game.

    Perhaps it could flash out rainbow colours in 4 groups of pulses, where the number of pulses corresponded with the Puck's MAC address that was displayed when advertising?

    Or maybe it just maps each hex digit to a hue, and does a 4-color sequence unique to that Puck. More quickly recognizable.

    It'd be nice to it to be able to connect to Pucks that are very close (high signal strength) and make them flash or something - but I think in a classroom environment that would just be more annoying than anything else :)

    I'm thinking of a separate program that enables you to select a nearby puck, and say "hi".

    I guess after an hour of not being used it could just completely clear itself so it went back to not using much power?

    Perhaps a long press of the button does a reset(). Or a long press followed by a short confirmation press. Maybe a super long press ("Help, I'm trapped under books in a backpack!") is detected and basically ignored.

  • in JavaScript
    Avatar for oesterle

    I'd try breaking sendForm() and bh.read() out of the dht.read() callback. Not sure if that will help, but it might relieve some memory shortage. Untested code:

    // global vars up near the top
    var lastTemp = "";
    var lastHumidity = "";
    var lastLight = "";
    function sendSensorData(){
       sendForm(lastTemp, lastHumidity, lastLight);
    // ........
    // further down, in place of your setInterval() section
    setInterval(function() {
      lastLight = Math.round(bh.read()).toString();
      dht.read(function (a) {
        lastTemp = a.temp.toString();
        lastHumidity = a.rh.toString();
        // let's give Espruino an opportunity to do housekeeping
        // before sending our form
        setTimeout(sendSensorData, 5000);
    }, 60000); // once a minute
  • in Projects
    Avatar for oesterle

    @Robin, @OwenBrotherwood: Yeah, maybe a 3.3v buck converter like this:

    …plus a USB 5v 1A battery pack.

    I've made this to replace the CR2032 on Puck.js with AA batteries:

  • in Projects
    Avatar for oesterle

    Very cool, @OwenBrotherwood! Laser cutting the wood, I see!

  • in Projects
    Avatar for oesterle

    I had some ideas for improving the robustness of your code, and forked your gist.

    • Ensure BLE is turned on when Puck is powered on or battery is replaced.
    • Ensure mag turning off doesn’t happen in the middle of presenting.
    • Puck.magOn() doesn’t return a Boolean to check if on/off; added code to
      fix this.
    • Simplified character sending code to remove duplicate code.
    • Added catchy keyboard Bluetooth device name. :-)

    Feel free to incorporate the changes into your code.

  • in Electronics
    Avatar for oesterle

    @OwenBrotherwood, This sensor from Adafruit is small, and will work on a fingertip, or clipped to an earlobe:

    It uses 4mA at 5v, and will also run at 3v, with just 3 wires – power, ground, and analog output.

    The hardware is open source, and detailed here:

  • in Projects
    Avatar for oesterle

    @Gordon, I've cleaned up the code quite a bit, and created a Hello, Puck! repo on Github.

    Download and try it out. I welcome y'all's ideas!

    It has quite a few convenience functions to make it easier to use the sensors, button, and LEDs.

    The idea is, how can we make Puck.js more interesting out-of-the-box, i.e., before it's connected to the IDE.

  • in Puck.js
    Avatar for oesterle

    The SunLED XZTNI53W-8 may be a drop-in replacement.

    • 60° angle, vs 120° (Kingbright)
    • 2.8 mW/sr, vs 2mW/sr (Kingbright) (CIE127-2007) (both at 20mA)

    • USD 0.23/ea in qty 100.

    Something like the SunLED XZTNI55W-3 might be interesting down the road. The footprint is 3.2 x 1.6mm (vs 1.6 x 0.8, for the Kingbright APT1608F3C).

    • 40° angle, vs 120° (Kingbright)
    • 4.8 mW/sr, vs 2mW/sr (Kingbright) (CIE127-2007) (both at 20mA)

    • USD 0.22/ea in qty 100.

    Supposedly, these are “Ideal for indication light on hand held products.” 🤔