用DAC0808实现数字调压
时间:11-17
来源:互联网
点击:
C代码:
#include
#define uint unsigned int
#define uchar unsigned char
sbit K1 = P3^0;
sbit K2 = P3^1;
sbit K3 = P3^2;
sbit K4 = P3^3;
sbit K5 = P3^4;
sbit K6 = P3^5;
sbit K7 = P3^6;
sbit K8 = P3^7;
void DelayMS(uint ms)
{
uchar i;
while(ms--)
{
for(i=0;i<120;i++);
}
}
void main()
{
P2 = 0x00;
while(1)
{
if(K1 == 0) P2 = 0;
if(K2 == 0) P2 = 35;
if(K3 == 0) P2 = 70;
if(K4 == 0) P2 = 105;
if(K5 == 0) P2 = 140;
if(K6 == 0) P2 = 175;
if(K7 == 0) P2 = 210;
if(K8 == 0) P2 = 255;
DelayMS(2);
}
}
仿真电路
DAC0808数字调 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)