如果不要求這些,就產生壹個方波。以51單片機為例。
# include & ltREG51。H & gt
sbit out=p1^0;//引腳可以修改。如果使用P0端口,應增加壹個拉電阻。
void delayus(無符號整數t)
{
while(t-);
}
void main()
while(1)
out = ~ out
德拉尤斯(10);//正脈沖時間,可以改變。
德拉尤斯(5);//負脈沖時間,可以改變。