Bチーム / Pswitch_Lib

Fork of Pswitch_Lib by Kero Sunutte

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Pswitch.h Source File

Pswitch.h

00001 #include "mbed.h"
00002 
00003      class Pswitch {
00004          public:      
00005               Pswitch(PinName in);
00006  
00007               int read (void);
00008               int count (void);
00009               operator int();
00010                
00011          private :    
00012                 // objects
00013                 DigitalIn _in;    
00014                 Ticker _ticker;
00015  
00016                 // function to take a sample, and update flags
00017                 void _sample(void);
00018  
00019                 // counters and flags
00020                 int _samples;
00021                 int _output;
00022                 int _output_last;
00023                 int _rising_flag;
00024  
00025      };
00026