This is a very tiny library which counts DigitalIn rising , using "Ticker" interrupts.

Fork of Pswitch_Lib by Kero Sunutte

Revision:
2:4588548211df
Parent:
0:0bc10e1c0685
--- a/Pswitch.cpp	Thu Dec 23 14:56:50 2010 +0000
+++ b/Pswitch.cpp	Tue Sep 23 08:42:55 2014 +0000
@@ -8,7 +8,9 @@
   */
  Pswitch::Pswitch(PinName in) 
      : _in(in) {    
-         
+     
+     _in.mode(PullUp);
+     
      // reset all the flags and counters    
      _samples = 0;
      _output = 0;
@@ -30,9 +32,6 @@
 	}
 
 }
-
- 
- 
  
  // return number of rising edges
  int Pswitch::count(void) {