標(biāo)題:
stm32f4拓展程序乒乓球?qū)嶒灒ǔ绦?代碼)
[打印本頁]
作者:
18892336058
時間:
2019-5-13 17:35
標(biāo)題:
stm32f4拓展程序乒乓球?qū)嶒灒ǔ绦?代碼)
stm32f4拓展程序乒乓球?qū)嶒?br />
單片機源程序如下:
#include "system.h"
#include "SysTick.h"
#include "led.h"
#include "usart.h"
#include "tftlcd.h"
#include "time.h"
#include "key.h"
#include "ball.h"
int main()
{
SysTick_Init(168);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //中斷優(yōu)先級分組 分2組
LED_Init();
KEY_Init();
USART1_Init(9600);
TFTLCD_Init(); //LCD初始化
LCD_Clear(BLUE);
LCD_ShowPictureEx(0, 0, 240, 400);
TIM2_Init(100,8399);
while(button!= KEY_UP) //等待按鍵K_UP按下
{
FRONT_COLOR=RED;
LCD_ShowString(20,10,tftlcd_data.width,tftlcd_data.height,16,"Press K_UP key to Enter...");
delay_ms(200);
LCD_ShowString(20,10,tftlcd_data.width,tftlcd_data.height,16," ");
delay_ms(200);
}
TIM_ITConfig(TIM2,TIM_IT_Update,DISABLE);
TIM_Cmd(TIM2, DISABLE); //失能TIMx
game_init_show();
TIM3_Init(100,83999);
TIM4_Init(10,83999);
while(1)
{
ball_play();
}
}
復(fù)制代碼
所有資料51hei提供下載:
乒乓球游戲.zip
(642.5 KB, 下載次數(shù): 18)
2019-5-13 17:33 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1