2024年2月17日 星期六

 首先到 mbed online IDE

https://ide.mbed.com/compiler/

第一次使用經過註冊程序就會看到IDE畫面



接著開始新增專案 mbed沒有提供STM32F4 DISC1版本

但是 Seeed Arch Max 剛好是使用 STMD32F407 這顆 MCU

所以選取 Seeed Arch Max 當作專案 platform

專案 template 選取 Blinky LED Hello World

程式碼修改如下:

#include "mbed.h"

#define BLINKING_RATE     500

int main()
{
    // Initialise PD12 as an output
    DigitalOut gLED(PD_12);
    
    while (true) {
        gLED = !gLED;
        ThisThread::sleep_for(BLINKING_RATE);
    }
}

按下介面上的 Compile 按鈕

mbed online IDE 會在完成後跳出下載 binary 檔案

將這個 .bin 檔存入 STM32F4 DISC1 的資料夾

最後就會看到 PD12 開始閃爍囉!

Reference

https://www.hackster.io/PSoC_Rocks/easy-programming-stm32f407-discovery-board-with-mbed-8ead8e

沒有留言:

張貼留言

Python Tkinter First Example

import tkinter as tk def on_closing():     root.destroy() class MainWindow(tk.Tk):     def __init__(self, *args, **kwargs):         tk.Tk.__...