@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);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Wilberforce,
emit
along the the line of pseudo code below:Setup of portexpander and enable interrupt on a pin A3:
with Internals of
.enableInterruptOn(pinName, callback, optionsObj) {...
and with
emit(...
on event