51单片机(AT89C52)D/A转换

来源:互联网 发布:国际象棋对下软件 编辑:程序博客网 时间:2024/06/05 19:14
#include<reg52.h>#define uchar unsigned char#define uint unsigned intsbit cs=P3^0;sbit wr=P3^1;void delayms(uint x){uint y,z;for(y=x;y>0;y--)for(z=110;z>0;z--);}void main(){uchar temp;cs=0;wr=0;while(1){P2=temp;delayms(25);temp++;}}


 

原创粉丝点击