Micro:bit 事件


Microbit_Event ??


屬性

  • BluetoothDevice – 連接至micro:bit 裝置之BluetoothLE元件。


方法

  • ReadTemperature – Read a single sample of temperature data from the micro:bit. On successful read, the TemperatureDataReceived event will be run.


  • ReadTemperaturePeriod – Read the current report rate for the micro:bit's 溫度感測器. After the period is read, it will be received by theTemperaturePeriodReceived event.


  • RequestTemperatureUpdates – Request notifications of changes in the micro:bit's 溫度感測器. Changes in the temperature will be reported at a rate determined by the last period value set by a call to WriteTemperaturePeriod. Temperature data will be reported through theTemperatureDataReceived event.


  • StopTemperatureUpdates – Stop receiving updates from the micro:bit's 溫度感測器. Note that there may be pending messages from the device that will still be reported through the TemperatureDataReceived event.


  • WriteTemperaturePeriod – Use the WriteTemperaturePeriod method to change how frequently the micro:bit sends temperature data to App Inventor. The period is measured in milliseconds.

    參數:

    • temperature_period_value (number) — The new reporting period for the micro:bit's 溫度感測器.



事件

  • TemperaturePeriodReceived – The TemperaturePeriodReceived event is run after the micro:bit's temperature reporting period is read from the device.

    參數:

    • temperature_period_value (number) — The current reporting interval for the micro:bit's 溫度感測器。


  • TemperatureReceived – The TemperatureReceived event is run whenever temperature samples are received from the micro:bit. This is usually a result of performing a read or request updates operation. The temperature value is measured in degrees Celsius.

    參數:

    • temperature_value (number) — The temperature measured by the micro:bit,單位為攝氏度。


  • WroteTemperaturePeriod – The WroteTemperaturePeriod event is run after the micro:bit's temperature reporting period is written to the device.

    參數:

    • temperature_period_value (number) — The new reporting interval for the micro:bit's 溫度感測器。





Comments