core :: union_find
union–find algorithm using an efficient disjoint-set data structure
module input is example
import bcm2835
assert bcm2835_init else print "Failed to init"
var out = new RPiPin.p1_11
out.fsel = new FunctionSelect.outp
out.write(false)
var inp = new RPiPin.p1_22
inp.fsel = new FunctionSelect.inpt
inp.pud = new PUDControl.down
var last_in = false
loop
var lev = inp.lev
if lev != last_in then
last_in = lev
if lev then print "button pressed"
end
out.write(true)
100.bcm2835_delay
out.write(false)
100.bcm2835_delay
end
lib/bcm2835/examples/input.nit:17,1--43,3