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.
IO_pwm/IO_pwm.h
- Committer:
- brainliang
- Date:
- 2019-03-16
- Revision:
- 0:d0c188d2cd1c
File content as of revision 0:d0c188d2cd1c:
/*
h文件
class 类名
{
public:
类名::构造函数(变量参数);
公有函数声明;
protected:
私有对象声明;
私有变量声明;
私有函数声明;
};
*/
#ifndef IO_pwm_H_
#define IO_pwm_H_
#include "mbed.h"
class IO_pwm
{
public:
IO_pwm(PinName n);
void pwm_io(int p_us, float dc);
protected:
//PWM的周期=on_delay+off_delay,高电平时间=on_delay
int on_delay;
int off_delay;
PinName _n;
// DigitalOutr mypwm;
Timeout timer;
void toggleOn(void);
void toggleOff(void);
};
#endif