探索 micro:bit 更多功能!

從跳舞機器人到香蕉鍵盤,micro:bit 擁有很多功能,你可以用這些寫出極棒的東西 - 無限可能!

An anatomy diagram of the BBC micro:bit

概觀

micro:bit 提供了這些硬體功能:

讓我們來看這些元件可以做什麼並且如何運用!

LEDs

The micro:bit LEDs

這是什麼? LED為發光二極體。micro:bit 有25個可程式化 LED,可供你作為顯示文字、數字及圖示。

如何使用? 參考 這個頁面 學習更多有關編寫 LED 程式,或者使用下面參考範例。

Python JavaScript Blocks

範例 - 參考使用JavaScript 會動的閃爍愛心 或學習如何使用Python做出 動畫效果!

按鈕

The micro:bit buttons

這是什麼? micro:bit 前板有兩個按鈕(被標記為A和B)。可以用來偵測當這些按鈕被按下時,觸發你所寫的事件。

如何使用? 請參考下面的範例程式。

Python JavaScript Blocks

範例 - 看一下這個 微笑按鈕 專案,或比較進階點的 投票機 專案,兩者都是透過JavaScript來控制按鈕。

接腳

The micro:bit pins

這是什麼? micro:bit 板子邊緣有25個連接點作為外部接腳用。 可以透過這些接腳來控制馬達、LED等其他電子元件,或者額外的感測器!

如何使用? 學習更多有關硬體接腳 這裡,或者使用下面的範例程式。

Python JavaScript Blocks

範例 - 使用JavaScript編寫程式碼 香蕉鍵盤入侵你的耳機,創建一個 牛奶盒卡通機器人! 或者,看一下這個 發怒的 micro:bit Python專案!

光感測器

The micro:bit LED screen, acting as a light sensor.

這是什麼? 以LED作為基本的光感測器,可讓LED偵測環境光線。

如何使用? 請參考下面的範例程式。

JavaScript Blocks

範例 - 學習如何使用JavaScript畫出亮度計 這裡

溫度計

The micro:bit temperature sensor

這是什麼? 允許micro:bit偵測目前環境溫度,以華氏表示。

如何使用? 請參考下面的範例程式。

Python JavaScript Blocks

範例 - 用JavaScript實做華氏和攝氏的 數位溫度計!

加速計

The micro:bit accelerometer

這是什麼?加速儀可以測量當micro:bit被移動時的加速度。它也能偵測其他動作,例如:搖晃、傾斜和墜落。

如何使用? 請參考下面的範例程式。

Python JavaScript Blocks

範例 - 用JavaScript實做剪刀、石頭、布,當micro:bit被搖動時觸發遊戲。 或者,用Pyhton創造音樂紛亂!

指南針

The micro:bit compass

What is it? The compass detects the earth's magnetic field, allowing you to detect which direction the micro:bit is facing. The compass has to be calibrated before it can be used.

'Calibrating' the compass ensures the compass results are accurate. For the JavaScript Blocks Editor, use the 'calibrate compass' block. To calibrate the compass in Python use compass.calibrate().

When the calibration begins, the micro:bit will scroll an instruction on the display for you - either "Draw a circle" or "Tilt to fill screen". To calibrate the compass, just follow these instructions and tilt the micro:bit to move the dot in the centre of the screen around until you have either drawn the outline of a circle, or filled up the whole screen.

How do I code it? Use the code references below.

Python JavaScript Blocks

Examples - create a working compass to find North in JavaScript or Python!

Radio

The micro:bit radio antenna

What is it? The radio feature allows you to communicate wirelessly between micro:bits. Use the radio to send messages to other micro:bits, build multiplayer games, and much more!

How do I code it? Discover how to code the radio:

Python JavaScript Blocks

Examples - create a Multiplayer Rock, Paper, Scissors game (JavaScript), or create cool digital fireflies in JavaScript and Python!

藍牙

The micro:bit bluetooth antenna

這是什麼? A BLE (Bluetooth Low Energy) antenna allows the micro:bit to send and receive Bluetooth signals. This allows the micro:bit to wirelessly communicate with PCs, Phones, and Tablets, so you can control your phone from your micro:bit and send code wirelessly to your device from your phone!

Before using the Bluetooth Antenna you will need to pair your micro:bit with another device. Once paired, you can send scripts wirelessly to your micro:bit - you can learn more about setting this up here.

How do I code it? Learn how to use the Bluetooth functionality:

JavaScript Blocks

The Python Editor doesn't currently support bluetooth.

What can I do with it? Send code to your micro:bit wirelessly - Learn More.

USB Interface

The micro:bit, connected via the USB interface

What is it? The USB interface allows you to connect the micro:bit to your computer via a micro-USB cable, which will power the device and allow you to download scripts onto the device.

How do I use it? You can read more information on how to run scripts on your BBC micro:bit here, and about the error messages you might get here.

Technical Info

Please refer to the hardware page to discover more about the micro:bit's technical and compliance info.

Hardware

Take a look at the apps page to learn more about coding the micro:bit from a mobile device.

Apps