其他分享
首页 > 其他分享> > STC大作业创新设计-乒乓游戏改进-代码

STC大作业创新设计-乒乓游戏改进-代码

作者:互联网

添加了STARTUP.A51,只有main.c\main.h进行了改动,其余和网站提供的内容一致
STARTUP.A51

$NOMOD51
;------------------------------------------------------------------------------
;  This file is part of the C51 Compiler package
;  Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
;  Version 8.01
;
;  *** <<< Use Configuration Wizard in Context Menu >>> ***
;------------------------------------------------------------------------------
;  STARTUP.A51:  This code is executed after processor reset.
;
;  To translate this file use A51 with the following invocation:
;
;     A51 STARTUP.A51
;
;  To link the modified STARTUP.OBJ file to your application use the following
;  Lx51 invocation:
;
;     Lx51 your object file list, STARTUP.OBJ  controls
;
;------------------------------------------------------------------------------
;
;  User-defined <h> Power-On Initialization of Memory
;
;  With the following EQU statements the initialization of memory
;  at processor reset can be defined:
;
; <o> IDATALEN: IDATA memory size <0x0-0x100>
;     <i> Note: The absolute start-address of IDATA memory is always 0
;     <i>       The IDATA space overlaps physically the DATA and BIT areas.
IDATALEN        EQU     80H
;
; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF> 
;     <i> The absolute start address of XDATA memory
XDATASTART      EQU     0     
;
; <o> XDATALEN: XDATA memory size <0x0-0xFFFF> 
;     <i> The length of XDATA memory in bytes.
XDATALEN        EQU     0      
;
; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF> 
;     <i> The absolute start address of PDATA memory
PDATASTART      EQU     0H
;
; <o> PDATALEN: PDATA memory size <0x0-0xFF> 
;     <i> The length of PDATA memory in bytes.
PDATALEN        EQU     0H
;
;</h>
;------------------------------------------------------------------------------
;
;<h> Reentrant Stack Initialization
;
;  The following EQU statements define the stack pointer for reentrant
;  functions and initialized it:
;
; <h> Stack Space for reentrant functions in the SMALL model.
;  <q> IBPSTACK: Enable SMALL model reentrant stack
;     <i> Stack space for reentrant functions in the SMALL model.
IBPSTACK        EQU     0       ; set to 1 if small reentrant is used.
;  <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
;     <i> Set the top of the stack to the highest location.
IBPSTACKTOP     EQU     0xFF +1     ; default 0FFH+1  
; </h>
;
; <h> Stack Space for reentrant functions in the LARGE model.      
;  <q> XBPSTACK: Enable LARGE model reentrant stack
;     <i> Stack space for reentrant functions in the LARGE model.
XBPSTACK        EQU     0       ; set to 1 if large reentrant is used.
;  <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
;     <i> Set the top of the stack to the highest location.
XBPSTACKTOP     EQU     0xFFFF +1   ; default 0FFFFH+1 
; </h>
;
; <h> Stack Space for reentrant functions in the COMPACT model.    
;  <q> PBPSTACK: Enable COMPACT model reentrant stack
;     <i> Stack space for reentrant functions in the COMPACT model.
PBPSTACK        EQU     0       ; set to 1 if compact reentrant is used.
;
;   <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
;     <i> Set the top of the stack to the highest location.
PBPSTACKTOP     EQU     0xFF +1     ; default 0FFH+1  
; </h>
;</h>
;------------------------------------------------------------------------------
;
;  Memory Page for Using the Compact Model with 64 KByte xdata RAM
;  <e>Compact Model Page Definition
;
;  <i>Define the XDATA page used for PDATA variables. 
;  <i>PPAGE must conform with the PPAGE set in the linker invocation.
;
; Enable pdata memory page initalization
PPAGEENABLE     EQU     0       ; set to 1 if pdata object are used.
;
; <o> PPAGE number <0x0-0xFF> 
; <i> uppermost 256-byte address of the page used for PDATA variables.
PPAGE           EQU     0
;
; <o> SFR address which supplies uppermost address byte <0x0-0xFF> 
; <i> most 8051 variants use P2 as uppermost address byte
PPAGE_SFR       DATA    0A0H
;
; </e>
;------------------------------------------------------------------------------

; Standard SFR Symbols 
ACC     DATA    0E0H
B       DATA    0F0H
SP      DATA    81H
DPL     DATA    82H
DPH     DATA    83H

                NAME    ?C_STARTUP


?C_C51STARTUP   SEGMENT   CODE
?STACK          SEGMENT   IDATA

                RSEG    ?STACK
                DS      1

                EXTRN CODE (?C_START)
                PUBLIC  ?C_STARTUP

                CSEG    AT      0
?C_STARTUP:     LJMP    STARTUP1

                RSEG    ?C_C51STARTUP

STARTUP1:

IF IDATALEN <> 0
                MOV     R0,#IDATALEN - 1
                CLR     A
IDATALOOP:      MOV     @R0,A
                DJNZ    R0,IDATALOOP
ENDIF

IF XDATALEN <> 0
                MOV     DPTR,#XDATASTART
                MOV     R7,#LOW (XDATALEN)
  IF (LOW (XDATALEN)) <> 0
                MOV     R6,#(HIGH (XDATALEN)) +1
  ELSE
                MOV     R6,#HIGH (XDATALEN)
  ENDIF
                CLR     A
XDATALOOP:      MOVX    @DPTR,A
                INC     DPTR
                DJNZ    R7,XDATALOOP
                DJNZ    R6,XDATALOOP
ENDIF

IF PPAGEENABLE <> 0
                MOV     PPAGE_SFR,#PPAGE
ENDIF

IF PDATALEN <> 0
                MOV     R0,#LOW (PDATASTART)
                MOV     R7,#LOW (PDATALEN)
                CLR     A
PDATALOOP:      MOVX    @R0,A
                INC     R0
                DJNZ    R7,PDATALOOP
ENDIF

IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)

                MOV     ?C_IBP,#LOW IBPSTACKTOP
ENDIF

IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)

                MOV     ?C_XBP,#HIGH XBPSTACKTOP
                MOV     ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF

IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
                MOV     ?C_PBP,#LOW PBPSTACKTOP
ENDIF

                MOV     SP,#?STACK-1

; This code is required if you use L51_BANK.A51 with Banking Mode 4
;<h> Code Banking
; <q> Select Bank 0 for L51_BANK.A51 Mode 4
#if 0   
;     <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
EXTRN CODE (?B_SWITCH0)
                CALL    ?B_SWITCH0      ; init bank mechanism to code bank 0
#endif
;</h>
                LJMP    ?C_START

                END

main.c

//******* Óû§³ÌÐò¶Î1£ºÓû§³ÌÐò°üº¬Îļþ *************//
#include "main.H"//´ËÐбØÐ룡£¡£¡ 
#include "stdlib.h"
#define uint unsigned int
#define uchar unsigned char
//******* Óû§³ÌÐò¶Î2£ºÓû§×Ô¶¨Ò庯ÊýÉùÃ÷ *************//
//******* Óû§³ÌÐò¶Î3£ºÓû§³ÌÐòÈ«¾Ö±äÁ¿¶¨Òå *************//
uchar show_w1,show_w2,show_w3,show_w4,show_w5,show_w6,show_w7,show_w8,v,s;//v:sÊǾֱȷÖ
uint i;//״̬²ÎÊý£¬0±íʾ×ó±ß¿ªÇò£¬1±íʾÓұ߿ªÇò£¬2±íʾµÈ´ý¿ªÇò£¬3±íʾ±ÈÈü½áÊø
uint P1score,P2score;//·Ö±ðÊÇ×ó±ßºÍÓұߵķÖÊý
uchar G_value;//LEDÏÔʾ
uchar k,l,ll,m;
uint n;//ÐèÒªÕýÈ·°´ÏµÄλÖÃ
uint seed=0;
//******* Óû§³ÌÐò¶Î4£ºÓû§×Ô¶¨Ò庯ÊýÔ­ÐÍ *************//
void pingpang_Init()
{
		n=rand()%8;
    i=2;//µÈ´ý¿ªÇò
		v=s=0;
		P1score=P2score=0;
    show_w1=n;
		show_w2=10;
		show_w3=0;
		show_w4=0;
	  show_w5=16;
		show_w6=17;
		show_w7=0;
		show_w8=0;			  
}
void my100mS_callback()
{
	  if(i==2)//i=2±íʾµÈ´ý¿ªÇò״̬
		{ 
			if(GetKeyAct(enumKey3)==enumKeyPress)//×ó±ß¿ªÇò 
			{
				i=0;
				G_value=0x80;//10000000
			}	
			else if(GetKeyAct(enumKey2)==enumKeyPress)//Óұ߿ªÇò
			{
				i=1;
				G_value=0x01;//00000001
			}
		}
		if(i==0)//´Ó×óÍùÓÒ¿ªÊ¼
		{
			G_value=G_value>>1;//ƹÅÒÇòÓÒÒÆ
			LedPrint(G_value);
			if(G_value==m)//Èç¹ûµ½ÓÒ±ßÁË»¹Ã»±»»÷´ò£¬×ó±ß·ÖÊý¼ÓÒ»
			{
			 	P1score++;
				show_w3=P1score/10;
				show_w4=P1score%10;
				SetBeep(300,10);
			}
	    if(G_value==0x00)
			{
				i=2;
				G_value=0x18;//00011000
			}
			if((GetKeyAct(enumKey2)==enumKeyPress)&&G_value==l)i=1;//ÇòÔÚÕýȷλÖÃʱ°´ÏÂKEY2£¬±íʾ»Ø»÷Çò		
		}
		else if(i==1)//´ÓÓÒÍù×ó¿ªÊ¼
		{
			G_value=G_value<<1;//ƹÅÒÇò×óÒÆ 
			LedPrint(G_value);
			if(G_value==k)//Èç¹ûµ½×ó±ßÁË»¹Ã»±»»÷´ò£¬Óұ߷ÖÊý¼ÓÒ»
			{
				P2score++;
				show_w7=P2score/10;
				show_w8=P2score%10;	
				SetBeep(300,10);
			}  
		  if(G_value==0x00)
			{
				i=2;
				G_value=0x18;
			}
			if((GetKeyAct(enumKey3)==enumKeyPress)&&G_value==ll)i=0;//ÇòÔÚÕýȷλÖÃʱ°´ÏÂKEY3£¬±íʾ»Ø»÷Çò
    }
		else if(i==3)//i=3ÊDZÈÈü½áÊø״̬£¬½øÐÐÉÁ˸
		{			
			G_value=0xFF;
			G_value=0x00;
			G_value=0xFF;
		}				
	  if (P1score-P2score>=2 && P1score>=11)//ÕâÒ»¾Ö×ó±ßÓ®ÁË
	  {   
			  P1score=P2score=0;
				v++;//×ó±ßÓ®ÁËÒ»¾Ö
				show_w3=P1score/10;
				show_w4=P1score%10;
			  show_w5=v;
				show_w6=s;
				show_w7=P2score/10;
				show_w8=P2score%10;
		}
    else if (P2score-P1score>=2 && P2score>=11)//ÕâÒ»¾ÖÓÒ±ßÓ®ÁË
	  {   
			  P1score=P2score=0;
				s++;//ÓÒ±ßÓ®ÁËÒ»¾Ö
				show_w3=P1score/10;
				show_w4=P1score%10;
			  show_w5=v;
				show_w6=s;
				show_w7=P2score/10;
				show_w8=P2score%10;
		}
	  else if (v>=2)//×ó±ßÏÈÓ®Á½¾Ö£¬±íÃ÷±ÈÈüʤÀû£¬ÖмäÏÔʾÁ½¸ö11£¬LEDÉÁ˸ 
	  {   
				v=s=0;
				P1score=P2score=0;
				i=3;
				show_w1=12;
				show_w2=12;
				show_w3=12;
				show_w4=1;
				show_w5=1;
				show_w6=12;
				show_w7=12;
				show_w8=12;		
			  SetBeep(300,100);
		}
    else if (s>=2)//ÓÒ±ßÏÈÓ®Á½¾Ö£¬±íÃ÷±ÈÈüʤÀû£¬ÖмäÏÔʾÁ½¸ö22£¬LEDÉÁ˸ 
	 	{  
				v=s=0;
				P1score=P2score=0;
				i=3;
				show_w1=12;
				show_w2=12;
				show_w3=12;
				show_w4=2;
				show_w5=2;
				show_w6=12;
				show_w7=12;
				show_w8=12;	
			  SetBeep(300,100);
		}
}
//******* main()º¯Êý *************//	
void main()//´ËÐбØÐ룡£¡£¡ 
{   
//******* Óû§³ÌÐò¶Î5£ºÓû§main()º¯ÊýÄÚ²¿¾Ö²¿±äÁ¿¶¨Òå *************//
//******* Óû§³ÌÐò¶Î6£ºÓû§main()º¯Êý£¨³õʼ»¯Àà³ÌÐò£© *************//		
	  Key_Init();
	  BeepInit();	
	  DisplayerInit();	  
    SetDisplayerArea(0,7);				
		LedPrint(0x18);
	  pingpang_Init();			
	  switch(n)	
		{
			case 0:k=0x00;l=0x01;ll=0x80;m=0x00;break; 
			case 1:k=0x80;l=0x02;ll=0x40;m=0x01;break; 
			case 2:k=0x40;l=0x04;ll=0x20;m=0x02;break; 
			case 3:k=0x20;l=0x08;ll=0x10;m=0x04;break; 
			case 4:k=0x20;ll=0x10;l=0x08;m=0x04;break; 
			case 5:k=0x40;ll=0x20;l=0x04;m=0x02;break; 
			case 6:k=0x80;ll=0x40;l=0x02;m=0x01;break; 
			case 7:k=0x00;ll=0x80;l=0x01;m=0x00;break; 
		}	
		SetEventCallBack(enumEventSys100mS,my100mS_callback); 
/*****************  MySTC_OS ³õʼ»¯Óë¼ÓÔØ¿ªÊ¼  ********************************/   
    MySTC_Init();//´ËÐбØÐ룡£¡£¡   
	  while(1)//´ËÐбØÐ룡£¡£¡   	
		{ 
			MySTC_OS();//´ËÐбØÐ룡£¡£¡
//******* Óû§³ÌÐò¶Î7£ºÓû§main()º¯Êý£¨Ö÷Ñ­»·³ÌÐò£© *************//
			Seg7Print(show_w1,show_w2,show_w3,show_w4,show_w5,show_w6,show_w7,show_w8);
		}//´ËÐбØÐ룡£¡£¡ 
}//´ËÐбØÐ룡£¡£¡ 

main.h

/**********************************  Ver3.3 ˵Ã÷ ********************************************************************
  (1) ϵͳ¹¤×÷ʱÖÓƵÂÊ¿ÉÒÔÔÚmain.cÖÐÐÞ¸Ä SysClock¸³Öµ£¨µ¥Î»Hz£©¡£
      È磺code long SysClock=11059200; ¶¨Òåϵͳ¹¤×÷ʱÖÓƵÂÊΪ11059200Hz£¨Ò²¼´11.0592MHz£©		
      ϵͳ¹¤×÷ƵÂʱØÐëÓëʵ¼Ê¹¤×÷ƵÂÊ£¨ÏÂÔØʱѡÔñµÄ£©Ò»Ö£¬ÒÔÃâÓ붨ʱÏà¹ØµÄËùÓй¦ÄܳöÏÖÎó²î»ò´íÎó¡£
	(2) ʹÓ÷½·¨£º
	        1£¬ÔÚ¹¤³ÌÖмÓÔØmain.cÎļþºÍSTC_BSP.lib¿âÎļþ
					2£¬ÔÚmain.cÖÐÑ¡Ôñ°üº¬ÒÔÏÂÍ·Îļþ£¨Èç¹ûҪʹÓÿÉÑ¡Ä£¿éÌṩµÄº¯ÊýºÍ·½·¨£¬¾Í±ØÐë°üº¬ÆäÍ·Îļþ£©	£º
								#include "STC15F2K60S2.H"        //±ØÐ룬"STC-Bѧϰ°å"ʹÓÃMCUÖ¸¶¨µÄÍ·Îļþ
								#include "sys.H"                 //±ØÐ룬sys£¨MySTC_OSµ÷¶È³ÌÐò£©Í·Îļþ
								#include "display.H"             //¿ÉÑ¡£¬display£¨ÏÔʾģ¿é£©Í·Îļþ¡£          
								#include "key.H"                 //¿ÉÑ¡£¬key£¨°´¼üÄ£¿é£©Í·Îļþ¡£
								#include "hall.H"                //¿ÉÑ¡£¬hall£¨»ô¶û´«¸ÐÆ÷Ä£¿é£©Í·Îļþ¡£
								#include "Vib.h"	               //¿ÉÑ¡£¬Vib£¨Õñ¶¯´«¸ÐÆ÷Ä£¿é£©Í·Îļþ¡£								 
								#include "beep.H"                //¿ÉÑ¡£¬beep£¨·äÃùÆ÷Ä£¿é£©Í·Îļþ¡£					
								#include "music.h"               //¿ÉÑ¡£¬music£¨ÒôÀÖ²¥·Å£©Í·Îļþ¡£	
								#include "adc.h"                 //¿ÉÑ¡£¬adc£¨ÈÈÃô¡¢¹âÃô¡¢µ¼º½°´¼ü¡¢À©Õ¹½Ó¿ÚADC¹¦ÄÜ£©Í·Îļþ¡£	
								#include "uart1.h"               //¿ÉÑ¡£¬uart1£¨´®¿Ú1ͨÐÅ£©Í·Îļþ¡£
								#include "uart2.h"               //¿ÉÑ¡£¬uart2£¨´®¿Ú2ͨÐÅ£©Í·Îļþ¡£
							  #include "stepmotor.h"           //¿ÉÑ¡£¬²½½øµç»ú      
                #include "DS1302.h"              //¿ÉÑ¡£¬DS1302ʵʱʱÖÓ
                #include "M24C02.h"              //¿ÉÑ¡£¬24C02·ÇÒ×ʧÐÔ´æ´¢Æ÷
                #include "FM_Radio.h"	           //¿ÉÑ¡£¬FMÊÕÒô»ú
                #include "EXT.h"                 //¿ÉÑ¡£¬EXTÀ©Õ¹½Ó¿Ú£¨µç×Ó³Ó¡¢³¬Éù²¨²â¾à¡¢Ðýת±àÂëÆ÷¡¢PWMÊä³ö¿ØÖƵç»ú¿ìÂýºÍÕý·´×ª£©
                #include "IR.h"	                 //¿ÉÑ¡£¬38KHzºìÍâͨÐÅ
								
					3£¬MySTC_Init()ÊÇsys³õʼ»¯º¯Êý£¬±ØÐëÖ´ÐÐÒ»´Î£»
					   MySTC_OS()ÊÇsysµ÷¶Èº¯Êý£¬Ó¦ÖÃÓÚwhile£¨1£©Ñ­»·ÖУ»
					4£¬¸÷¿ÉÑ¡Ä£¿éÈç¹ûÑ¡Ó㬱ØÐëÔÚʹÓÃÄ£¿éÆäËüº¯ÊýºÍ·½·¨Ç°Ö´ÐÐÒ»´ÎÄ£¿éËùÌṩµÄÇý¶¯º¯Êý£¨ÉèÖÃÏà¹ØÓ²¼þ¡¢²¢ÔÚsysÖмÓÔØÆ书Äܵ÷¶È£©£º
						    DisplayerInit();      //ÏÔʾģ¿éÇý¶¯ 
								Key_Init();           //°´¼üÄ£¿éÇý¶¯
								BeepInit();	          //·äÃùÆ÷Ä£¿éÇý¶¯
								MusicPlayerInit();    //·äÃùÆ÷²¥·ÅÒôÀÖÇý¶¯
	              HallInit();           //»ô¶û´«¸ÐÆ÷Ä£¿éÇý¶¯                      
	              VibInit();            //Õñ¶¯´«¸ÐÆ÷Ä£¿éÇý¶¯          
	              AdcInit();            //Ä£Êýת»»ADCÄ£¿éÇý¶¯£¨º¬Î¶ȡ¢¹âÕÕ¡¢µ¼º½°´¼üÓë°´¼üKey3¡¢EXTÀ©Õ¹½Ó¿ÚÉϵÄADC£©
	              StepMotorInit();      //²½½øµç»úÄ£¿éÇý¶¯	                  
    	          DS1302Init();         //DS1302ʵʱʱÖÓÇý¶¯
	              FMRadioInit();	      //FMÊÕÒô»úÇý¶¯           
                EXTInit();            //À©Õ¹½Ó¿ÚÇý¶¯£¨º¬µç×Ó³Ó¡¢³¬Éù²¨²â¾à¡¢Ðýת±àÂëÆ÷¡¢PWMÊä³ö£¬µ«²»º¬EXTÉÏUart2ºÍÓëÖ®Ïà¹ØÓ¦Óã©
	              Uart1Init();          //Uart1£¨´®¿Ú1£©Çý¶¯£ºUSBÉÏ£¨Óë¼ÆËã»úͨÐÅ£©              
                Uart2Init();          //Uart2£¨´®¿Ú2£©Çý¶¯£º485½Ó¿Ú¡¢»òEXTÀ©Õ¹½Ó¿Ú£¨¶à»úͨÐÅ¡¢Uart·½Ê½Ä£¿éÈçÀ¶ÑÀÄ£¿é£© 
	              IrInit();             //38KHzºìÍâͨÐÅÄ£¿éÇý¶¯
								
							˵Ã÷£ºÓв¿·ÖÄ£¿é²»ÐèÒªÇý¶¯£»Çý¶¯º¯ÊýÓÐЩÓвÎÊý¡££¨¾ßÌå¼û¸÷Ä£¿éÍ·Îļþ˵Ã÷£©
								
          5£¬sysºÍ¸÷Ä£¿é¹²ÌṩÒÔÏÂʼþ£º
					      numEventSys1mS:              1mSʼþ                        £¨"1ºÁÃëʱ¼ä¼ä¸ôµ½"ʼþ£©
					      enumEventSys10mS:            10mSʼþ                       £¨"10ºÁÃëʱ¼ä¼ä¸ôµ½"ʼþ£©
				        enumEventSys100mS:           100mSʼþ                      £¨"100ºÁÃëʱ¼ä¼ä¸ôµ½"ʼþ£©
								enumEventSys1S:              1Sʼþ                         £¨"1Ãëʱ¼ä¼ä¸ôµ½"ʼþ£©
								enumEventKey:                °´¼üʼþ                       £¨K1¡¢K2¡¢K3 Èý¸ö°´¼üÓÐ"°´ÏÂ"»ò"̧Æð"²Ù×÷£©
								enumEventHall:               »ô¶û´«¸ÐÆ÷ʼþ                 £¨»ô¶û´«¸ÐÆ÷ÓÐ"´Å³¡½Ó½ü"»ò"´Å³¡À뿪"ʼþ£©
 								enumEventVib:                Õñ¶¯´«¸ÐÆ÷ʼþ                 £¨Õñ¶¯¸ÐÆ÷¼ì²âµ½"Õñ¶¯"ʼþ£©
								enumEventNav:                µ¼º½°´¼üʼþ                   £¨µ¼º½°´¼ü5¸ö·½Ïò¡¢»ò°´¼üK3 ÓÐ"°´ÏÂ"»ò"̧Æð"²Ù×÷£©
								enumEventXADC:               À©Õ¹½Ó¿ÚÉÏÍê³ÉÒ»´ÎADCת»»Ê¼þ  £¨P1.0¡¢P1.1²ÉÈ¡µ½Ò»×éÐÂÊý¾Ý£©
								enumEventUart1Rxd:           Uart1ÊÕµ½ÁËÒ»¸ö·ûºÏÖ¸¶¨ÒªÇó£¨Êý¾Ý°üÍ·Æ¥Åä¡¢Êý¾Ý°ü´óСһÖ£©µÄÊý¾Ý°ü
	              enumEventUart2Rxd:           Uart2ÊÕµ½ÁËÒ»¸ö·ûºÏÖ¸¶¨ÒªÇó£¨Êý¾Ý°üÍ·Æ¥Åä¡¢Êý¾Ý°ü´óСһÖ£©µÄÊý¾Ý°ü   
	              enumEventIrRxd:              ºìÍâ½ÓÊÕÆ÷IrÉÏÊÕµ½Ò»¸öÊý¾Ý°ü						
								
								¶ÔÕâЩʼþ£¬Ó¦²ÉÓÃ"»Øµ÷º¯Êý"·½·¨ÏìÓ¦£¨¼´ÓÃsysÌṩµÄSetEventCallBack()ÉèÖÃÓû§»Øµ÷º¯Êý£©£¬ÒÔÌá¸ßϵͳÐÔÄÜ¡£
								
					6£¬¸÷¿ÉÑ¡Ä£¿éÌṩµÄÆäËüº¯ÊýºÍ¾ßÌåʹÓ÷½·¨Çë²Î¼û£º
					      ¸÷Ä£¿éÍ·ÎļþÖеÄ˵Ã÷£»
								main.cÌṩµÄÍƼö³ÌÐò¿ò¼ÜºÍ²¿·ÖʾÀý£»
								ÆäËü¿ÉÄܼ¼ÊõÎĵµ»òÓ¦ÓÃʾÀý
						
±àд£ºÐì³É£¨µç»°18008400450£©   2021Äê2ÔÂ26ÈÕÉè¼Æ£¬2021Äê9ÔÂ1ÈÕ¸üÐÂ
**************************************************************************/

#include "STC15F2K60S2.H"        //±ØÐë¡£
#include "sys.H"                 //±ØÐë¡£
#include "displayer.H" 
#include "key.h"
#include "hall.h"
#include "Vib.h"
#include "beep.h"
#include "music.h"
#include "adc.h"
#include "uart1.h"
#include "uart2.h"
#include "stepmotor.h"
#include "DS1302.h"
#include "M24C02.h"
#include "FM_Radio.h"	
#include "EXT.h"
#include "IR.h"

code unsigned long SysClock=11059200;         //±ØÐë¡£¶¨Òåϵͳ¹¤×÷ʱÖÓƵÂÊ(Hz)£¬Óû§±ØÐëÐ޸ijÉÓëʵ¼Ê¹¤×÷ƵÂÊ£¨ÏÂÔØʱѡÔñµÄ£©Ò»ÖÂ
#ifdef _displayer_H_                          //ÏÔʾģ¿éÑ¡ÓÃʱ±ØÐë¡££¨ÊýÂë¹ÜÏÔʾÒëÂë±í£¬ÓÑô¿ÉÐ޸ġ¢Ôö¼ÓµÈ£© 
code char decode_table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x08,0x40,0x01, 0x41, 0x48, 0x3E, 0x6D,
	              /* ÐòºÅ:   0   1    2	   3    4	    5    6	  7    8	  9	  10	  11		12   13    14    15    16   17  */
                /* ÏÔʾ:   0   1    2    3    4     5    6    7    8    9  (ÎÞ)  ÏÂ-    ÖÐ-  ÉÏ-  ÉÏÖÐ-  ÖÐÏÂ-  V   S   */  
	                       0x3f|0x80,0x06|0x80,0x5b|0x80,0x4f|0x80,0x66|0x80,0x6d|0x80,0x7d|0x80,0x07|0x80,0x7f|0x80,0x6f|0x80 };  
             /* ´øСÊýµã     0         1         2         3         4         5         6         7         8         9*/
#endif

标签:10,STC,show,EQU,乒乓,作业,value,0x80,include
来源: https://blog.csdn.net/qq_45785060/article/details/120373083