Mirjana Radosavljevic / Mbed 2 deprecated BMS_Master-Test

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

PwmIn Class Reference

PwmIn Class Reference

PwmIn class to read PWM inputs. More...

#include <PwmIn.h>

Public Member Functions

 PwmIn (PinName p)
 Create a PwmIn.
float period ()
 Read the current period.
float pulsewidth ()
 Read the current pulsewidth.
float dutycycle ()
 Read the current dutycycle.

Detailed Description

PwmIn class to read PWM inputs.

Uses InterruptIn to measure the changes on the input and record the time they occur

Note:
uses InterruptIn, so not available on p19/p20

Definition at line 13 of file PwmIn.h.


Constructor & Destructor Documentation

PwmIn ( PinName  p )

Create a PwmIn.

Parameters:
pThe pwm input pin (must support InterruptIn)

Definition at line 3 of file PwmIn.cpp.


Member Function Documentation

float dutycycle (  )

Read the current dutycycle.

Returns:
the dutycycle as a percentage, represented between 0.0-1.0

Definition at line 19 of file PwmIn.cpp.

float period (  )

Read the current period.

Returns:
the period in seconds

Definition at line 11 of file PwmIn.cpp.

float pulsewidth (  )

Read the current pulsewidth.

Returns:
the pulsewidth in seconds

Definition at line 15 of file PwmIn.cpp.