📄 main.c
字号:
//-----------------------------------------------------
// TinyARM DIP40 LPC2106 example code
//-----------------------------------------------------
// Modified by I.Paulik-PASAT for TinyARM board
// The original code is from IAR
//-----------------------------------------------------
// -------------------------------------------------------------------
// THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// -------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <intrinsics.h>
#include "timer.h"
#include "lpc210x.h"
int main(void)
{
unsigned long number,Var;
// System initialization, this will map the exception vectors.
LPC210xSystemInit();
// Set up peripheral registers.
LPC210xInitPIO();
// First disable interrupts.
__disable_interrupt();
// Setup interrupt controller.
LPC210xInitInterrupt(TimerBeat);
// Periodic timer initialization.
LPC210xInitTimer();
// Enable interrupts.
__enable_interrupt();
// Start periodic timer.
LPC210xStartTimer();
// Loop forever.
for (;;)
{
Var=1;
for (number = 0; number < 32; number++)
{
// Display number on 7-segment display.
LPC210xSevenSegmentDisplay(number);
LPC210xLedSet(Var);
Var <<= 1;
Sleep(200); // Display for 200 ms.
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -