新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > DAC0832數(shù)模轉(zhuǎn)換實驗

DAC0832數(shù)模轉(zhuǎn)換實驗

作者: 時間:2016-11-13 來源:網(wǎng)絡(luò) 收藏
#include

#include
#define uchar unsigned char
#define uint unsigned int
uchar tt;
uint temp;

本文引用地址:http://butianyuan.cn/article/201611/316311.htm

void delay(uint z)
{
uint x,y;
for(x=110;x>0;x--)
for(y=z;y>0;y--);
}
void main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
while(1)
{

for(temp=0x80;temp<0xff;temp++)
{
P0=temp;
delay(10);

}
for(temp=0xff;temp>0x80;temp--)
{
P0=temp;
delay(10);
}

}
}

void timer0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
}



關(guān)鍵詞: DAC0832數(shù)模轉(zhuǎn)

評論


技術(shù)專區(qū)

關(guān)閉