📄 adc.c
字号:
//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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -