Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PwmIn.h
00001 //mbed Microcontroller Library 00002 //Pulse Width Modulation Input Interface 00003 //Copyright 2010 00004 //Thomas Hamilton 00005 00006 #ifndef PwmInLibrary 00007 #define PwmInLibrary 00008 00009 #include "stdint.h" 00010 #include "mbed.h" 00011 00012 class PwmIn : private InterruptIn, Timer 00013 { 00014 private: 00015 unsigned int PeriodMeasurement; 00016 unsigned int PulseWidthMeasurement; 00017 00018 void PulseStart(); 00019 void PulseStop(); 00020 00021 public: 00022 PwmIn(PinName pwi); 00023 float read(); 00024 float period(); 00025 int period_ms(); 00026 int period_us(); 00027 float pulsewidth(); 00028 int pulsewidth_ms(); 00029 int pulsewidth_us(); 00030 }; 00031 00032 #endif
Generated on Thu Jul 14 2022 10:11:24 by
1.7.2