callt549.c

来自「这是调用TLC549的汇编程序(STLC549.ASM)的C51程序, */ 」· C语言 代码 · 共 29 行

C
29
字号
/* 这是调用TLC549的汇编程序(STLC549.ASM)的C51程序,   */
/* 文件名CALLT549.C                                    */
/* 功能:本程序主要是读出输入通道ANALOG IN的           */
/*       模数转换值,并将转换值放在变量chai中。         */

#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
void delay1(uint x);

extern uchar chai;          //把全局变量chai声明为外部变量 
extern uchar a_func(uchar); //把a_func(uchar)声明为外部函数

void delay1(uint x)         //延时程序
{
 uchar tw;
 while (x-->0){
 for (tw=0;tw<125;tw++){;}
 }
}

void main()
{
  delay1(10);
  EA=0;
  chai=a_func(0);         //带参数调用 
  while(1);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?