網路搜尋mbed,進入mbed官方網站
https://www.mbed.com/zh-cn/
mbed官網提供線上的IDE,但需要有mbed帳號才可使用。尚未擁有帳號的同學,請註冊一份並登錄。
點擊IDE左上角的「NEW」;或者在「My Program」右鍵
開啟選單後,點擊「New Program」
確定Platform無誤後,Template選「Empty Program」,然後決定你的Program名稱吧。
platform:板子型號(IDE通常會幫你填上)
Template:一些範例專案與空白專案
Program Name:專案名稱
對Program右鍵開啟選單,點擊「New File」
決定File的名稱 (名稱後面加上.cpp才能按下OK)
一個Program內只能有一個File.cpp
#include "mbed.h"
int main()
{
printf("Hello My Darkness Friend");
}
程式碼完成後,點擊上方的「Compile」,如果沒有報錯的話,IDE會給你程式轉換後的二進位檔(.bin)的下載連結。
將下載後的二進位檔,丟入到裝置內(跟你放東西到隨身碟一樣)
程式燒入過程中,Board的LD4 LED會發彩虹光,等待變綠燈代表燒錄完畢。(板子不同可能就不是LD4)
電腦沒「ST-Link」驅動程式則需要填寫信箱獲得下載連結,下載安裝驅動程式後重新開機。(沒安裝Tera Term無法獲得STM32板子的printf訊息)
下載並安裝tera term後,開啟tera term,點選Serial,選擇連接Board的COM。(不清楚哪個COM,可以在"你的作業系統/控制台/裝置管理員/連接阜查看")
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing