Usually programs have a main loop. This need not always be the case though. It's a kind of old fashioned and pointless idea.
Code: Select all
var wpi = require('wiring-pi');
console.log('Pin 7 changed to LOW (', delta, ')');
wpi.wiringPiISR(7, wpi.INT_EDGE_FALLING, doStuff);
See documentation here: https://github.com/eugeneware/wiring-pi ... NTATION.md
Or we could imagine programming on the bare metal of the processor, no operating system at all, and just setting up interrupt handlers to handle events.