亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码

專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

PIC單片機(jī)寫的交通燈程序

作者:佚名   來(lái)源:不詳   點(diǎn)擊數(shù):  更新時(shí)間:2014年09月18日   【字體:

沒錢買片子只能用虛擬了。建議大家不要學(xué)pic,pic沒學(xué)頭,要搞就搞arm 

#include<pic.h>
#include<stdio.h>
#define uint unsigned int
#define uchar unsigned char
uchar H_time=0,L_time=0;
const uchar tab[]={0x0a,0x22,0x11,0x14};
extern uchar code[]={0x00,0x00,0x00,0x00};
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=5;y>0;y--);
}
void light(uchar n)
{
uchar i,top,temp;
for(;n>0;n--)
{
PORTC=H_time*16+L_time;
H_time++;L_time++;
temp=0x00;
for(i=0;i<0xff;i++)
{
temp++;
PORTD=temp;
delay(2);
}
}
}
void RGB_light()
{
PORTB=tab[0];
light(7);H_time=0x00;
PORTB=tab[1];
light(2);H_time=0x00;L_time=0x00;
PORTB=tab[2];
light(7);L_time=0x00;
PORTB=tab[3];
light(2);H_time=0x00;L_time=0x00;
PORTB=0X00;

}
void main()
{
TRISD=0;
TRISB=0;
TRISC=0;
while(1)
{
RGB_light();
}

}

 

關(guān)閉窗口

相關(guān)文章