#include "reg52.h"
#define SD 0
//==========================
sbit CS=P0^0;
sbit CLK=P0^1;
sbit DI =P0^2;
sbit DO =P0^3;
//============================
unsigned char bdata ADC_BIT;
sbit ADC0=ADC_BIT^0;
sbit ADC1=ADC_BIT^1;
sbit ADC2=ADC_BIT^2;
sbit ADC3=ADC_BIT^3;
sbit ADC4=ADC_BIT^4;
sbit ADC5=ADC_BIT^5;
sbit ADC6=ADC_BIT^6;
sbit ADC7=ADC_BIT^7;
//==============================
char numf[]={0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xe6};
char numz[]={0xff,0x01,0x02,0x04,0x08};//数码管位选
// 关闭 个位 十位 百位 千位
void yc(int n); //延时n毫秒
void smg_xs (int num)
{
char ws[]={0,0,0,0,0};
//位数,个十百千
//个 十 百 千
if(num>999&&num<9999)
{

这篇博客介绍了如何用C语言编写ADC0832的子程序,包括初始化、读取数据以及转换数值的过程。通过示例代码展示了如何连接和配置ADC0832,以读取模拟信号并转换为数字值。
最低0.47元/天 解锁文章
1736

被折叠的 条评论
为什么被折叠?



