感應器
學習如何程式設計您的 micro:bit,並且利用它內建感測器來測量您的環境。
加速度感測器(Accelerometer)
加速器是一個測量動作的感測器。 您的 BBC micro:bit 中的加速器會偵測您何時擺動它向左向右、向後向前和向上向下傾斜。
您有很多方法可以在您的項目中使用加速器。 透過觀看視訊來瞭解更多關於它如何工作,然後選擇一個項目開始。
![](https://cdn.sanity.io/images/ajwvhvgo/production/ba880a2e890bee1f34ac651de7317cdd1a0ccc78-4032x3024.jpg?bg=fff&w=232&h=174&q=90&fit=min&auto=format)
用兩個micro:bit 重新創建經典遊戲
![](https://cdn.sanity.io/images/ajwvhvgo/production/a19fde8f802b8d97b45e6e263760469b3a69b4f7-3605x2704.jpg?bg=fff&w=232&h=174&q=90&fit=min&auto=format)
使用micro:bit製作自己的計步器
![](https://cdn.sanity.io/images/ajwvhvgo/production/82e3caae8913cd429cde11dc8d9d8bb72dd7cd29-800x600.png?bg=fff&w=232&h=174&q=90&fit=min&auto=format)
Use data logging to make a better step counter
溫度感應器
溫度感測器是一個測量溫度的輸入裝置。 您的 BBC micro:bit 的處理器內有一個溫度感測器,可以給您一個概略的大氣溫度值。
透過觀看視訊來瞭解更多關於您的 micro:bit 上的溫度感測器的資訊,然後選擇其中一個項目來對溫度感測器進行程式設計。
![](https://cdn.sanity.io/images/ajwvhvgo/production/2baf587dd448d81d9b4dd24dab787dab0d8e67db-1703x1155.png?rect=82,0,1540,1155&bg=fff&w=232&h=174&q=90&fit=min&auto=format)
用您的micro:bit製作一個簡單的溫度計
![](https://cdn.sanity.io/images/ajwvhvgo/production/c8495b2e58a2f608762dc31ddb21fdac19a4a34e-2839x1910.png?rect=146,0,2547,1910&bg=fff&w=232&h=174&q=90&fit=min&auto=format)
感測外面的溫度
![](https://cdn.sanity.io/images/ajwvhvgo/production/150bf24f3814f45975af8f45ec8a4307d27dcff3-800x599.jpg?rect=1,0,799,599&bg=fff&w=232&h=174&q=90&fit=min&auto=format)
Record and study data about the world around you
光感應器
光線感測器是一個測量光度水準的輸入裝置。 您的 BBC micro:bit 使用 LED 來感知光度水準,並讓您把您的 micro:bit 程式設計為一個光線感測器。
觀看視訊來瞭解更多的資訊,然後選擇其中一個項目將您的 micro:bit 變成一個光線感測器。
![](https://cdn.sanity.io/images/ajwvhvgo/production/4572241a79420fd41573eba7f179a430049ae490-1960x1470.png?bg=fff&w=232&h=174&q=90&fit=min&auto=format)
Create an automatic light that turns on when it’s dark.
![](https://cdn.sanity.io/images/ajwvhvgo/production/b59ea6498371d14067a6b7b93fe8455520255589-1440x1080.jpg?bg=fff&w=232&h=174&q=90&fit=min&auto=format)
Measure temperature, sound and light levels around you
![](https://cdn.sanity.io/images/ajwvhvgo/production/8d3b13741cb45f770f8f75b3c9e5a79168f7f424-2097x1538.png?rect=23,0,2051,1538&bg=fff&w=232&h=174&q=90&fit=min&auto=format)
發出警報,當燈點亮時響起
羅盤(Compass)
數位指南針是一個檢測磁場的輸入感測器。 您的 BBC micro:bit 有一個內建的指南針,可以偵測到它所面朝的方向。
觀看視訊來瞭解更多的資訊,然後選擇一個項目,開始使用您的 micro:bit 作為指南針。
觸控標誌 - 新的
如果您有新的 micro:bit,您可以在您的項目中使用金色標誌來作為另一個輸入。 這就像有一個額外的按鍵。
觸控標誌使用電容式觸控,可感測電場的微小變化藉以瞭解您的手指何時按壓它 - 就像您的手機或平板螢幕。
當您像按鍵一樣按下它時,您可以在程式中觸發事件,或者您第一次觸摸它,而當您放開時,或是如果您按壓它更長的時間。
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.