
Module
Connect Type Available Connectors
Rotary Sensor Analog
A0, A1, A2
Block API
Get the percentage
獲取當前的旋轉百分比。
該值表示旋轉模塊旋轉了多少。
Get the current rotary percentage.
This value means how much you have rotated the
rotary module.
function RotaryGetPercentage(connName: AnalogConnName): number;
Parameters
•
connName
is the analog connector's name.
this module can only be pluged into
analog connector A0,A1 and A2.
Light Sensor event
配置
mcu
定期檢查旋轉
AD
值,然後每當
AD
值更改時執行相關的代碼塊。
Configure the mcu check the rotary AD value periodically, and then execute the
associated code block whenever the AD value changes.
function onRotaryEvent(connName: AnalogConnName, body: () => void): voi
d;
Parameters
•
connName
is the analog connector's name.this module can only be pluged into
analog connector A0,A1 and A2.
Example
Show the percentage
此示例顯示如何獲取當前百分比,並將其顯示在
LED
屏幕上。