⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_remote.c

📁 单片机开发资料光盘-双龙-686M.zip
💻 C
字号:
//ICC-AVR application builder : 03-1-21 13:42:41
// Target : 8515
// Crystal: 8.0000Mhz
// Test remote
//     B   C
//   D   A 
// C----8D4---PA3---PB3
// A----8D3---PA2---PB2
// B----8D2---PA1---PB1
// D----8D1---PA0---PB0

#include <io8515v.h>
#include <macros.h>
#include <sl3010.c>

unsigned char remote;

//call this routine to initialise all peripherals
void init_devices(void)
{
 //stop errant interrupts until set up
 CLI(); //disable all interrupts
 port_init();

 MCUCR = 0x00;
 GIMSK = 0x00;
 TIMSK = 0x00;
 SEI(); //re-enable interrupts
 //all peripherals are now initialised
}

//
void main(void)
{
 init_devices();
 while (1)
   	{
	 remote = PINB & 0xF0;
	 PORTA = ~remote;
	}
}

⌨️ 快捷键说明

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