ad_test.c

来自「使用embest IDE开发工具开发的基于LPC2294 的触摸屏开发」· C语言 代码 · 共 80 行

C
80
字号
/*
**********************************************************************************************
*
*     		  Embest Info&Tech Co., Ltd.  All rights reserved.
*                   		  www.embedinfo.com
*			
*file:     		xxx.c/xxx.h 
*author:   		embest 
*establish: 	2006.xx.xx
*modify:		xx
*notes:			xx
**********************************************************************************************
*/

/*
**********************************************************************************************
*                                       include files
**********************************************************************************************
*/
#include	"..\..\com\lpc_lib_AD\lpc_lib_AD.h"
#include	"..\..\com\lpc_lib_uart\lpc_lib_uart.h"
/*
**********************************************************************************************
*                                     local function declare
**********************************************************************************************
*/
void AD_test(void);
/*
**********************************************************************************************
*                               extern function/variable declare
**********************************************************************************************
*/

/*
**********************************************************************************************
*                                  global variable define 
**********************************************************************************************
*/


/*
**********************************************************************************************
* name:		function name
* func:		effect
* para:		form parameter
* ret:		return value description
* modify:
* comment:		
**********************************************************************************************
*/		
	
void Main(void)
{	
	lpc_init_pll_manual();
	INT8U *str[128];	
     uart0_init(57600); 					//set baudrate 19200			
		
	 uart0_printf("\n\nwelcome,:)\n");
	 uart0_printf("nothing impossible!\n");
	 uart0_printf("we all are hero!\n\n"); 
 	 AD_test();

}


void AD_test(void)
{
	INT32U data;
	AD_init(0,AIN6,0,0);
	
	while(1)
	{
		data=AD_read();
		uart0_printf("\r%d,",data);
		time_dly(500);
	}
}


⌨️ 快捷键说明

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