Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rick Waldron
    @rwaldron
    When I added i2cRead to Firmata.js, I wanted that to match analogRead, digitalRead
    so if you adjust your i2c command params with the read “mode” after the address and bfore the register, you’ll be all set
    Donovan Buck
    @dtex
    Cool, I’ll fix that. I totally had it backwards in my head.
    Rick Waldron
    @rwaldron
    On the standard firmata side, there is a mask whose value is 24
    mode = READ_MODE & MASK
    READ_MODE is the value you sent from imp-io
    MASK = 24
    Rick Waldron
    @rwaldron
    For the reporting part, you could consolidate digital reading into a single value and shift the bits in imp-io to derive the pin values
    there are only 6 pins, so you’d have two unused bits
    (because you’d use a single 8 bit value)
    This is what spark-io does
    fortunately, you wont also have to split that value into two 7-bit values haha
    Analog reads cannot follow this pattern, since the value is 0-1023, not 0-1
    same with i2c
    but it still reduces all digital reading to one report
    @dtex looks like we’re already using sampling interval on the io-plugin side: https://github.com/rwaldron/imp-io/blob/master/lib/imp.js#L377-L381
    just coordinate that with whatever you’ve got on the tyrion side?
    ok, i need to walk dogs now
    back in a few
    Donovan Buck
    @dtex
    Okay, I’ve got the digital read and sampling interval work done and I’m about to do the sub mode work for I2C but I still think I have a special case here. After sending the result of a single non-continuous read to the agent, I need to keep that value coming until I know for sure that imp-io has received it. In other words, I may need it to live for more than one interval depending on timing, luck, connectivity, etc. It seems to me I have to be able to send some kind of ack to let the device know it can stop reporting.
    Donovan Buck
    @dtex
    Nevermind, I have a solution.
    Donovan Buck
    @dtex
    @rwaldron @soundanalogous Thank you guys for the tip on that button debounce thing. It totally solved what I thought was a problem with imp-io/Tyrion.
    Jesse cogollo
    @jessecogollo
    Hi everyone, I have a question.
    Anyone tried to use the proximity component HCSR04 with a electric imp?
    I am following this link https://johnny-five.readthedocs.io/en/stable/proximity-hcsr04/
    But I get the next error:
    TypeError: this.io.pingRead is not a function
    'use strict';
    
    const five = require("johnny-five");
    const Imp = require("imp-io");
    
    const board = new five.Board({
      io: new Imp({
        agent:  process.env.IMP_AGENT_ID
      })
    });
    
    board.on("ready", function() {
      let proximity = new five.Proximity({
        controller: "HCSR04",
        pin: 7
      });
    
      proximity.on("data", function() {
        console.log("Proximity: ");
        console.log("  cm  : ", this.cm);
        console.log("  in  : ", this.in);
        console.log("-----------------");
      });
    
      proximity.on("change", function() {
        console.log("The obstruction has moved.");
      });
    });
    Donovan Buck
    @dtex
    PingRead has not been implemented in Imp-io
    Jesse cogollo
    @jessecogollo
    😱
    J.Coleman
    @AlphaNerd

    Hey room... newb here. New to gitter and imp-io. Looking for some help with my Imp-io setup. My node app is crashing if my imp is not on and connectable. Is there something I'm missing here? Even when I use a try{} catch(e){} it still crashed my server.

    Would like to be able to have it simply return an error I can log out.

    Anyone know what to do here?

    This message was deleted
    try{
        var board = new five.Board({
          io: new Imp({
            agent: "############"
          })
        });
        board.on("ready", function() {
          var led = new five.Led(1);
    
          led.blink(1000);
        });
    }
    
    catch(e){
        console.log("Can't connect to Imp")
    }
    Donovan Buck
    @dtex
    Are you getting an error message when it crashes?