📄 main.c
字号:
// --------------------------------------------------------------------
//
// Title : MAIN
// :
// Library :
// :
// Developers: MICROTIME MDS group
// :
// Purpose : DIP2LED
// :
// Limitation:
// :
// Note :
// :
// --------------------------------------------------------------------
// modification history :
// --------------------------------------------------------------------
// Version| mod. date: |
// V1.0 | 03/31/2003 | First release
// --------------------------------------------------------------------
//
// Note:
//
// MICROTIME COMPUTER INC.
//
//
/*************************************************************************
Include files
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <inarm.h>
#include "driver.h"
/*************************************************************************
MAIN Program
*************************************************************************/
int main(void)
{
while (1)
{
UC ch;
IO_REG2 = 0xff00;
ch = IO_REG1;
if(ch & 1)
{
IO_REG2 = 0xfe00;
Delay (500);
IO_REG2 = 0xfd00;
Delay (500);
IO_REG2 = 0xfb00;
Delay (500);
IO_REG2 = 0xf700;
Delay (500);
IO_REG2 = 0xef00;
Delay (500);
IO_REG2 = 0xdf00;
Delay (500);
IO_REG2 = 0xbf00;
Delay (500);
IO_REG2 = 0x7f00;
Delay (500);
}
if(ch & 2)
{
IO_REG2 = 0x5500;
Delay (500);
IO_REG2 = 0xAA00;
Delay (500);
}
if(ch & 4)
{
IO_REG2 = 0xf000;
Delay (500);
IO_REG2 = 0x0f00;
Delay (500);
}
if(ch & 8)
{
IO_REG2 = 0x7f00;
Delay (500);
IO_REG2 = 0xbf00;
Delay (500);
IO_REG2 = 0xdf00;
Delay (500);
IO_REG2 = 0xef00;
Delay (500);
IO_REG2 = 0xf700;
Delay (500);
IO_REG2 = 0xfb00;
Delay (500);
IO_REG2 = 0xfd00;
Delay (500);
IO_REG2 = 0xfe00;
Delay (500);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -