欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: STM32F103C8T6單片機(jī)鍵盤掃描測試程序 [打印本頁]

作者: 254413002    時間: 2021-6-27 09:52
標(biāo)題: STM32F103C8T6單片機(jī)鍵盤掃描測試程序
  1. #include "stm32f10x.h"
  2. //#include "led.h"
  3. #include "delay.h"
  4. #include "key.h"
  5. #include "sys.h"
  6. //#include "beep.h"
  7. #include "oled_iic.h"
  8. #include "display.h"
  9. //#include "24cxx.h"
  10. //#include "myiic.h"
  11. //#include "timer.h"
  12. //#include "as608.h"
  13. //#include "usart3.h"
  14. //#include "motor.h"
  15. #include "string.h"
  16. #include "stdio.h"

  17.       


  18. int main(void)
  19. {
  20.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
  21.         GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
  22.         vu8 key=0;
  23.         delay_init();
  24.         HZ= GB16_NUM();
  25.         OLED_Init();
  26.         KEY_Init();
  27.         char str[20];
  28.         OLED_Clear();
  29.   
  30.         while(1)
  31.         {
  32.                 key=KEY_Scan(0);
  33.                 if(key!=0)
  34.                 {
  35.                         sprintf(str,"key:%d",key);
  36.                         OLED_Clear();
  37.                         OLED_ShowCH(0,2,(u8*)str);
  38.                         delay_ms(1000);
  39.                         OLED_Clear();
  40.                         key=0;
  41.                 }
  42.                 else
  43.                 {
  44.                         OLED_ShowCH(0,2,"請按key");
  45.                 }
  46.         }
  47. }
復(fù)制代碼

代碼: 測試-鍵盤.7z (197.24 KB, 下載次數(shù): 18)





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1