My modifications/additions to the code

Dependencies:   ADXL345 ADXL345_I2C IMUfilter ITG3200 Servo fishgait mbed-rtos mbed pixy_cam

Fork of robotic_fish_ver_4_8 by jetfishteam

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, float dutyMin, float dutyMax)
 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 14 of file PwmIn.h.


Constructor & Destructor Documentation

PwmIn ( PinName  p,
float  dutyMin,
float  dutyMax 
)

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 25 of file PwmIn.cpp.

float period (  )

Read the current period.

Returns:
the period in seconds

Definition at line 17 of file PwmIn.cpp.

float pulsewidth (  )

Read the current pulsewidth.

Returns:
the pulsewidth in seconds

Definition at line 21 of file PwmIn.cpp.