51單片機(jī)由軟件實(shí)現(xiàn)的PWM控的LED漸亮、漸暗效果
sbit LEDR= P2 ^ 5; //P2.0引腳上接了一個(gè)紅的發(fā)光二極管
本文引用地址:http://www.ex-cimer.com/article/201611/315728.htmsbit LEDG = P2 ^ 6; //P2.1引腳上接了一個(gè)綠的發(fā)光二極管
void delay (unsigned char d){ // 延時(shí)功能函數(shù)--由d決定延時(shí)長(zhǎng)度
unsigned char i;
while( d-- != 0)
{
for(i = 0; i < 8; i++);
}
}
void delay1 (unsigned int d){ // 延時(shí)功能函數(shù)--由d決定延時(shí)長(zhǎng)度
unsigned char i;
while( d-- != 0)
{
for(i = 0; i < 8; i++);
}
}
//Speed 1~9
//Direct 1看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();