adc.c

来自「智能遥控车代码」· C语言 代码 · 共 54 行

C
54
字号
//ADC.c : source file for the ADC project
//

#include "ADC.h"
#include "ADCADC.h"

/////////////////////////////////////////////////////////////////////////////
//ADC

static void io_init(void)
{
	//{{WIZARD_MAP(General)
	//}}WIZARD_MAP(General)

	//{{WIZARD_MAP(I/O Ports)
	// PortB
	PORTB = 0x0;
	DDRB = 0x0;
	// PortC
	PORTC = 0x0;
	DDRC = 0x0;
	// PortD
	PORTD = 0x0;
	DDRD = 0x0;
	//}}WIZARD_MAP(I/O Ports)

	//{{WIZARD_MAP(Watchdog)
	// Watchdog Enabled, Prescaler: OSC/16k
	wdt_enable(WDTO_15MS);
	//}}WIZARD_MAP(Watchdog)

	//{{WIZARD_MAP(Analog Comparator)
	// Analog Comparator Disabled
	ACSR = 0x80;
	//}}WIZARD_MAP(Analog Comparator)
}

int main(void)
{
	//{{WIZARD_MAP(Initialization)
	io_init();
	adc_init();
	//}}WIZARD_MAP(Initialization)
	// TODO: Add extra initialization here
	
	//{{WIZARD_MAP(Global interrupt)
	//}}WIZARD_MAP(Global interrupt)
	while(1)
	{
		// TODO: Add your code here
		
	}
}

⌨️ 快捷键说明

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