资源简介
该资源为用51写的AD驱动程序,可供程序直接调用,很方便。
代码片段和文件信息
#include
#include
#include
#define ulong unsigned long
#define uint unsigned int
#define uchar unsigned char
uchar code table[7]=“DianYa“;
uchar code table1[10]=“0123456789“;
sbit rs=P2^0;
sbit rw=P2^1;
sbit en=P2^2;
sbit a=P2^0;
sbit b=P2^1;
sbit c=P2^2;
sbit d=P2^3;
sbit e=P2^4;
sbit f=P2^5;
sbit g=P2^6;
sbit h=P2^7;
void write_com(uchar com);
void write_date(uchar date);
void delay(uchar z);
sbit ADCS =P1^3; //ADC0832 chip seclect
sbit ADDI =P1^1; //ADC0832 data in
sbit ADDO =P1^1; //ADC0832 data out
sbit ADCLK =P1^0; //ADC0832 clock signal
unsigned int Adc0832(unsigned char channel);
/************
读ADC0832函数
************/
//采集并返回
unsigned int Adc0832(unsigned char channel)
{
uchar i=0;
uchar j;
uint dat=0;
u
评论
共有 条评论