0.0.1 • Published 8 years ago

pulse_counter v0.0.1

Weekly downloads
7
License
-
Repository
-
Last release
8 years ago

Pulse counter library for Raspberry pi

Warning this is not tested yet!

/*
    "INT_EDGE_FALLING",
    "INT_EDGE_RISING"
    "INT_EDGE_BOTH"
*/
//pulse source is connected to pin 6. Edge is rising
addon.init(6,"INT_EDGE_RISING");

//start pulse counter
addon.start();

//clear pulse counter
addon.clear();

setTimeout(function() {
    //read the count of pulses
    console.info(addon.get());
    
    //stop pulse counting
    addon.stop();
}, 30000);