main.c

来自「AVR单片机ATmega16的串口测试程序」· C语言 代码 · 共 23 行

C
23
字号
#include "M16_USART.h"

int main(void)
{
	uint16 tmp;
	uint8 tmp1;
	usart_init_std();
	DDRA = 0xff;
	DDRB = 0xff;
	PORTB = 0x00;
	PORTA = 0x00;
	tmp = usart_receive9();
	tmp1 = tmp >>8;
	while (1)
	{
		PORTA = (uint8)tmp;
		PORTB = tmp1;
		_delay_ms(10);
		PORTA = 0x00;
		PORTB = 0x00;
	}
	return 0;
}

⌨️ 快捷键说明

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