• @Wilberforce, emit along the the line of pseudo code below:

    Setup of portexpander and enable interrupt on a pin A3:

    var x = require("PX23017").connect(...);
    x.enableInterruptOn("A3", function(state, time, lastTime) { // service interrupt on pin A3
        //   code to serve interrupt
      ),{ ...  }); // interrupt options...
    

    with Internals of .enableInterruptOn(pinName, callback, optionsObj) {...

    ...
    // handle the options object
    ...
    this.on(pinName,callback); // prep for the emit(...
    ... 
    

    and with emit(... on event

    ...
    // figuring out event details, such as pin, state, time, lastTime
    var pinNane = ....; // for example "A3"
    ...
    this.emit(pinName, state, time, lastTime);
    
About

Avatar for allObjects @allObjects started