David Lloyd / Mbed 2 deprecated SF800_flowmeter

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

counter Class Reference

counter Class Reference

Includes. More...

#include <counter.h>

Public Member Functions

 counter (PinName channelA)
 Constructor.
void reset (void)
 Reset the encoder.
int getPulses (void)
 Read the number of pulses recorded by the encoder.

Detailed Description

Includes.

Simple counter

Definition at line 12 of file counter.h.


Constructor & Destructor Documentation

counter ( PinName  channelA )

Constructor.

Attaches the encode function to the rise/fall edge of channels A.

Parameters:
channelAmbed pin for counter input.

Definition at line 8 of file counter.cpp.


Member Function Documentation

int getPulses ( void   )

Read the number of pulses recorded by the encoder.

Returns:
Number of pulses which have occured.

Definition at line 21 of file counter.cpp.

void reset ( void   )

Reset the encoder.

Sets the pulses and revolutions count to zero.

Definition at line 15 of file counter.cpp.