📄 test_led8x8.c
字号:
/****************************************************************************
【文 件 名 称】Test_LED8X8.C
【功 能 描 述】三星S3C2410A板demo程序代码
【程 序 版 本】4.0
【创建人及创建日期】icesoar//2002年11月19日19:26
【修改人及修改日期】icesoar//2004-12-8 17:25
****************************************************************************/
//***************************************************************************
#include "def.h"
#include "2410addr.h"
#include "config.h"
#include "board.h"
#include "utils.h"
//***************************************************************************
#define LED8X8_Address *(volatile U16 *)( 0x080001000 ) //nGCS1
U16 LED8X8_Disp1[8] = { 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa } ; /*定义特定的显示数组*/
U16 LED8X8_Disp2[8] = { 0xff,0x81,0xbd,0xa5,0xa5,0xbd,0x81,0xff } ; /*定义特定的显示数组*/
U16 LED8X8_Disp3[8] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff } ; /*定义特定的显示数组*/
//***************************************************************************
/****************************************************************************
【功能说明】步进电机实验程序
****************************************************************************/
void LED8X8_Display( U16 *LED8X8, U32 d )
{
U16 m ;
while( d-- )
{
for( m = 0; m < 8; m++ )
{
LED8X8_Address = ( (1<<(8+m))&0xff00 ) | ( (~LED8X8[m]) & 0x00ff ) ;
Delay( 2 ) ;
}
}
}
/****************************************************************************
【功能说明】步进电机实验程序
****************************************************************************/
void Test_LED8X8(void)
{
printf( "S3C2410A 8X8 LED 点阵显示实验, press ESC key to exit !\n" ) ;
while( getkey() != ESC_KEY )
{
LED8X8_Display( LED8X8_Disp1, 30 ) ;
LED8X8_Display( LED8X8_Disp2, 30 ) ;
LED8X8_Display( LED8X8_Disp3, 30 ) ;
}
LED8X8_Address = 0xffff ; //关闭LED点阵的显示
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -