如何在有WebUSB 的Chrome瀏覽器支持下,使用Makecode 一鍵下載至micro:bit (包含行動裝置)
2018-11-11 20:03如何在有WebUSB 的Chrome瀏覽器支持下,使用Makecode 一鍵下載至micro:bit (包含行動裝置)
WebUSB for micro:bit on Chrome Browser
WebUSB is an emerging web standard that allows to access micro:bit from web pages. It allows for a one-click download without installing any additional app or software! It also allows to receive data from the micro:bit.
WebUSB是一種新興的Web標準,允許從網頁訪問micro:bit。 它允許一鍵下載而無需安裝任何其他應用程序或軟件! 它還允許從micro:bit接收數據。
Support (支持)
- Chrome 65+ browser for Android, Chrome OS, Linux, macOS and Windows 10.
Prepare your micro:bit
Make sure that your micro:bit is running version 0249 or above of the firmware. Upgrading is as easy as dragging a file and it takes a few seconds to get it done.
準備你的micro:bit
確保您的micro:bit 在運行版本0249或更高版本的韌體。 升級就像拖動文件一樣簡單,只需幾秒鐘即可完成。
Pair your micro:bit
Here are the steps on the supported browsers:
- connect your micro:bit to your computer with the microUSB cable
- open a project.
- open the gearwheel menu and select Pair device
- click on the Pair device button and select BBC micro:bit CMSIS-DAP or DAPLink CMSIS-DAP from the list.
配對你的micro:bit
以下是支持的瀏覽器上的步驟:
•使用microUSB電纜將micro:bit連接到計算機
•打開一個項目。
•打開齒輪菜單並選擇配對設備
•單擊配對設備按鈕,然後從列表中選擇BBC micro:位CMSIS-DAP或DAPLink CMSIS-DAP。
If you don’t see any devices in the list and micro:bit has the right firmware (0249 or above), you can create a support ticket to notify the Micro:bit Foundation of the problem. Skip the rest of these steps.
如果列表中沒有顯示任何設備且micro:bit具有正確的韌體(0249或更高版本),則可以創建支持憑單(support ticket)以通知Micro:bit Foundation。 跳過其餘的步驟。
One-click Download
Once your micro:bit is paired, MakeCode will use WebUSB to transfer the code without having to drag and drop. Happy coding!
Console output
MakeCode will be able to “listen” to your micro:bit and display the console output.
一鍵下載
一旦你的micro:bit配對,MakeCode將使用WebUSB傳輸代碼而不必拖放。 快樂的編碼!
控制台輸出
MakeCode將能夠“監聽”你的micro:bit並顯示控制台輸出。
Updating your micro:bit firmware
What is the micro:bit firmware?
Firmware is a special kind of software that makes devices function properly. You can think of it as the software that makes a machine behave the way it does. The micro:bit has two chips on the back of it; one of them runs your code, while the other one runs the firmware to enable you to program the device.
什麼是micro:bit 韌體?
韌體是一種特殊的軟件,可以使設備正常運行。 您可以將其視為使機器以其運行方式運行的軟件。 micro:bit背面有兩個芯片; 其中一個運行您的代碼,而另一個運行韌體以使您能夠對設備進行編程。
The micro:bit will work with the firmware it came with, so if you don't need to update it head back to our guide to the micro:bit features.
There may be times when you may want to update the firmware to test out new software features. If that's the case, this page will show you how to do it.
micro:bit將與它附帶的韌體一起使用,因此如果您不需要更新它,請返回我們的micro:bit功能指南(guide to the micro:bit features)。
有時您可能希望更新韌體以測試新的軟件功能( test out new software features)。 如果是這種情況,此頁面將告訴您如何操作。
How to find out the current firmware version
如何找出當前的韌體版本
Before you upgrade, you'll want to find out what version of the firmware you have on your micro:bit. Plug it in via USB, open up the DETAILS.TXT file fom the MICROBIT drive and look for the number on the line that begins 'Interface
Version'.
在升級之前,您需要了解micro:bit上的韌體版本。 通過USB插入,打開MICROBIT驅動器上的DETAILS.TXT文件,並查找開頭的數字'接口
版'。
# DAPLink Firmware - see https://mbed.com/daplink Unique ID: 9900000031634e4500624014000000320000000097969901
HIC ID: 97969901
Auto Reset: 1
Automation allowed: 0
Overflow detection: 0
Daplink Mode: Interface
Interface Version: 0249
Git SHA: 682d8303e37355532402b8d93c4f240a3cec02a9
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Interface CRC: 0x3f2b7e12
Remount count: 0
URL: https://microbit.org/device/?id=9900&v=0249
How to update the firmware
- Download the hex file from this page to your computer.
Download the latest micro:bit firmware
- Then with the battery pack removed and a USB lead connected, hold the reset button at the back of the micro:bit and plug the USB lead into your computer. You should see a drive appear in your file manager called MAINTENANCE.
如何更新韌體
1.將此頁面中的hex文件下載到您的計算機。
下載最新的micro:bit韌體
2.然後取下電池組並連接USB導線,按住micro:位背面的複位按鈕,將USB導線插入計算機。 您應該會在文件管理器中看到名為MAINTENANCE的驅動器。
- Drag and drop the .HEX you downloaded form this page onto the micro:bit and wait for the yellow system LED on the back of the device to stop flashing. When the upgrade is completed, the micro:bit will reset, ejecting itself from the computer and re-appear in normal MICROBIT drive mode.
- Finally, check the DETAILS.TXT file that is on the MICROBIT drive and make sure that it has the same version number as the .HEX firmware that you just downloaded and flashed to the interface chip.
3.將您從此頁面下載的.HEX拖放到micro:bit,然後等待設備背面的黃色系統LED停止閃爍。 升級完成後,micro:bit 將重置,從計算機中,彈出並重新出現在正常的MICROBIT驅動模式下。
4.最後,檢查MICROBIT驅動器上的DETAILS.TXT文件,確保它與您剛剛下載並閃存到接口芯片的.HEX韌體具有相同的版本號。
Previous firmware versions
Should you wish to roll back the firmware for any reason, you can download a previous version here.
以前的韌體版本
如果您因任何原因希望回滾韌體,可以在此處下載以前的版本。
Troubleshooting downloads with WebUSB
Having issues pairing your micro:bit with WebUSB? Let’s try to figure out why!
將您的micro:bit與WebUSB配對,有問題? 讓我們試著找出原因!
Step 1: Check your cable
Make sure that your micro:bit is connected to your computer with a micro USB cable. You should see a MICROBIT drive appear in Windows Explorer when it’s connected.
確保micro:bit通過micro USB線連接到計算機。 您應該看到MICROBIT驅動器在連接時出現在Windows資源管理器中。
If you can see the MICROBIT drive go to step 2.
If you can’t see the drive:
- Make sure that the USB cable is working.
Does the cable work on another computer? If not, find a different cable to use. Some cables may only provide a power connection and don’t actually transfer data.
- Try another USB port on your computer.
Is the cable good but you still can’t see the MICROBIT drive? Hmm, you might have a problem with your micro:bit. Try the additional steps described in the fault finding page at microbit.org. If this doesn’t help, you can create a support ticket to notify the Micro:bit Foundation of the problem. Skip the rest of these steps.
如果您可以看到MICROBIT驅動器,請轉到步驟2。
如果你看不到驅動器:
•確保USB電纜正常工作。
電纜在另一台計算機上工作嗎? 如果沒有,請找到要使用的其他電纜。 某些電纜可能僅提供電源連接,並且實際上不會傳輸數據。
•嘗試使用計算機上的其他USB端口。
電纜是否良好,但您仍然看不到MICROBIT驅動器? 嗯,你的micro:bit可能有問題。 嘗試在microbit.org的故障查找頁面中描述的其他步驟。 如果這沒有幫助,您可以創建一個支持服務單以通知Micro:bit Foundation的問題。 跳過其餘的步驟。
Step 2: Check your firmware version
It’s possible that the firmware version on the micro:bit needs an update. Let’s check:
micro:bit上的韌體版本可能需要更新。 讓我們檢查:
- Go to the MICROBIT drive.
- Open the DETAILS.TXT file.
- Look for a line in the file that says the version number. It should say Version: ...
If the version is 0234, 0241, 0243 you NEED to update the firmware on your micro:bit. Go to Step 3 and follow the upgrade instructions.
If the version is 0249, 0250 or higher, you have the right firmware go to step 4.
如果版本是0234,0241,0243,則需要更新micro:bit上的韌體。 轉到步驟3並按照升級說明進行操作。
如果版本為0249,0250或更高版本,則使用正確的韌體轉到步驟4。
Step 3: Upgrade the firmware
- Download the latest firmware .hex file
- Drag and drop that file onto the MAINTENANCE drive.
- The yellow LED will flash while the
HEX
file is copying. When the copy finishes, the LED will go off and the micro:bit resets. The MAINTENANCE drive now changes back to MICROBIT. - The upgrade is complete! You can open the DETAILS.TXT file to check and see that the firmware version changed to the match the version of the
HEX
file you copied.
If you want to know more about connecting the board, MAINTENANCE Mode, and upgrading the firmware, read about it in the Firmware guide.
2.下載最新的韌體.hex文件
3.將該文件拖放到MAINTENANCE驅動器上。
4. HEX文件複製時,黃色LED將閃爍。 複製完成後,LED將熄滅,micro:位複位。 MAINTENANCE驅動器現在更改回MICROBIT。
5.升級完成! 您可以打開DETAILS.TXT文件以檢查並查看韌體版本是否更改為與您複製的HEX文件的版本相匹配。
如果您想了解有關連接電路板,維護模式和升級韌體的更多信息,請在韌體指南中閱讀相關內容。
Step 4: Check your browser version
WebUSB is a fairly new feature and may require you to update your browser. Check that your browser version matches one of these:
WebUSB是一項相當新的功能,可能需要您更新瀏覽器。 檢查您的瀏覽器版本是否與以下內容匹配:
- Chrome 65+ for Android, Chrome OS, Linux, macOS and Windows 10.
Step 5: Pair device
Once you’ve updated the firmware, open the Chrome Browser, go to the editor and click on Pair Device in the gearwheel menu. See WebUSB for pairing instructions.
Enjoy fast downloads!
更新韌體後,打開Chrome瀏覽器,轉到編輯器,然後單擊齒輪菜單中的配對設備。 有關配對說明,請參閱WebUSB。
享受快速下載!
標籤:
—————