找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2444|回复: 1
收起左侧

关于stm32F103和stm32F4的俄罗斯方块代码

[复制链接]
ID:457004 发表于 2018-12-28 09:54 | 显示全部楼层 |阅读模式
用stm32F103和stm32F4写俄罗斯方块代码有何不同

单片机源程序如下:
  1. #include "stm32f10x.h"
  2. #include "stm32_eval.h"
  3. #include "key.h"
  4. #include "app.h"
  5. #include "printf.h"
  6. #include "adc.h"
  7. #include "lcd.h"
  8. //#include "bmp.c"
  9. #include "backimg.c"
  10. #include "RussiaGame.h"
  11.   #define GPIO_LED                   GPIOF   
  12.   #define RCC_APB2Periph_GPIO_LED    RCC_APB2Periph_GPIOF
  13. extern __IO uint16_t ADCConvertedValue;
  14. extern __IO int sys_count;
  15. //extern u8 Image_Table[];

  16. /** @addtogroup STM32F10x_StdPeriph_Examples
  17.   * @{
  18.   */
  19. GPIO_InitTypeDef GPIO_InitStructure;

  20. /** @addtogroup EXTI_Example
  21.   * @{
  22.   */

  23. /* Private typedef -----------------------------------------------------------*/
  24. /* Private define ------------------------------------------------------------*/
  25. /* Private macro -------------------------------------------------------------*/
  26. /* Private variables ---------------------------------------------------------*/
  27. /* Private function prototypes -----------------------------------------------*/
  28. /* Private functions ---------------------------------------------------------*/

  29. /**
  30.   * @brief  Main program.
  31.   * @param  None
  32.   * @retval None
  33.   */
  34. extern u8 dis_tab_now[19][9];
  35. int main(void)
  36. {  
  37.   //int x=0,y=0;
  38.   
  39.   SystemInit();
  40.   InitUsart1();
  41.   STM3210E_LCD_Init();
  42.   KeyInit();
  43.   LedInit();
  44.   RussiaGameInit();
  45.   Printf("\r\nSysterm Init.");
  46.   while (1)
  47.   {
  48.           SecondHandle();
  49.         KeyHandle();
  50.         ChicRusiaStatus();
  51.   }
  52. }

  53. #ifdef  USE_FULL_ASSERT
  54. /**
  55.   * @brief  Reports the name of the source file and the source line number
  56.   *   where the assert_param error has occurred.
  57.   * @param  file: pointer to the source file name
  58.   * @param  line: assert_param error line source number
  59.   * @retval None
  60.   */
  61. void assert_failed(uint8_t* file, uint32_t line)
  62. {
  63.   /* User can add his own implementation to report the file name and line number,
  64.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  65.   /* Infinite loop */
  66.   while (1)
  67.   {
  68.   }
  69. }
  70. #endif

  71. /**
  72.   * @}
  73.   */

  74. /**
  75.   * @}
  76.   */

  77. /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
复制代码

所有资料51hei提供下载:
21.俄罗斯方块.rar (530.01 KB, 下载次数: 46)
回复

使用道具 举报

ID:1 发表于 2018-12-28 16:05 | 显示全部楼层
补全原理图或者详细说明一下电路连接即可获得100+黑币
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表