STM32F407 多功能跑馬燈

2021-09-27 09:10:08 字數 1118 閱讀 3833

自律即自強!

1、完成多功能跑馬燈專案。。

2、預習中斷。。

##多功能跑馬燈

#include "sys.h"

#include "delay.h"

#include "usart.h"

#include "led.h"

#include "beep.h"

#include "key.h"

//alientek 探索者stm32f407開發板 實驗3

//按鍵輸入實驗-庫函式版本

//技術支援:www.openedv.com

//**店鋪:

//廣州市星翼電子科技****

int main(void)

}else delay_ms(10);

if(onoff)

else if(dir==0&&speed==1&&change==0) //state2

else if(dir==1&&speed==1&&change==0) //state3

else if(dir==1&&speed==0&&change==0) //state4

else if(dir==0&&speed==0&&change==1) //state5

else if(dir==0&&speed==1&&change==1) //state6

else if(dir==1&&speed==1&&change==1) //state7

else if(dir==1&&speed==0&&change==1) //state8

else if(dir==0&&speed==0&&change==2) //state9

else if(dir==0&&speed==1&&change==2) //state10

else if(dir==1&&speed==1&&change==2) //state11

else if(dir==1&&speed==0&&change==2) //state12

}else

}}

STM32F407 跑馬燈實驗

1 庫函式版本呼叫的函式有哪些?對應的原始檔 標頭檔案是哪個?庫函式 原始檔 標頭檔案 rcc ahb1periphclockcmd rcc ahb1periph gpiof,enable stm32f4xx rcc.c stm32f4xx rcc.h gpio init gpiof,gpio in...

STM32F407 串列埠顯示跑馬燈狀態

main.c include sys.h include delay.h include usart.h include led.h include beep.h include key.h include exti.h extern u8 onoff,dir,speed,change,flag e...

STM32F407 跑馬燈 庫函式版 個人筆記

mcu在開發板原理圖的第二頁,led在開發板原理圖的第三頁 由圖可知,pf9 pf10 若輸出低電平則燈亮,高電平則燈滅 選推挽輸出 使能io口時鐘。呼叫函式rcc ahb1periphclockcmd 不同的外設呼叫的時鐘使能函式可能不一樣 初始化io口模式。呼叫函式gpio init 操作io口...