
Block API
Control the motor speed
我們使用此塊來控制電機的速度。您可以通過調整第二個參數來改變速度,範圍從
0
到
100
。
We use this block to control the motor's speed.
you can change the speed by
adjustmenting the second parameter,
range from 0 to 100.
function FanControl_1(connName:AnalogConnName , speed:number): void
Parameters
•
connName
is the analog connector's name.this module can only be pluged into
analog connector and digital connector.
•
speed
is the speed of the motor.The adjustment range is from 0 to 100.which 0
means the motor is shuting down and 100 means the fastest speed.
Example
Use button to control the motor's speed.
本示例說明如何使用按鈕
A
和
B
控制電機轉速。
按鈕
A
控制電機加速,按鈕
B
控
制電機減速。
This example show you how to use the button A and B control the motor speed .
Button A control the motor to speed up, button B control the motor to deceleration.