基于51單片機的AD8080驅動程序
#include#define uchar unsigned charsbit P2_1=P2^1; //定義數碼管位碼端口sbit P2_2=P2^2;sbit P2_3=P2^3;sbit OE=P3^0; //定義ADC0808端口sbit EOC=P3^1;sbit ST=P3^2;sbit P3_4=P3^4;sbit P3_5=P3^5;sbit P3_6=P3^6;uchar code leddata_dot[]={0x40,0x79,0x24,0x30,0x19,0x12};//帶小數點的0~5六個uchar code leddata[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};//共陽極0~9十個段碼/段碼//*********************************//延時子程序//*********************************void delay(uchar n){ uchar i,j;for(i=0;i
評論