Arduino101Servo 伺服
Arduino 101 Servo 扩展程序允许用户远程控制连接到 Arduino 101 的伺服电机。
更多链接<ul><li>下载 Arduino 101 Servo 的示例项目。</li></ul>
属性
BluetoothDevice
– The BluetoothLE component with a connection to the Arduino 101.
方法
IsSupported
– Tests whether the Bluetooth low energy device is broadcasting support for the service. If true, calls to TurnOn and TurnOff should work correctly. Otherwise an error will be reported through the Screen’s ErrorOccurred event.
Parameters:
* <code>position</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) —
The new position of the servo in degrees. Valid values are 0-180.
SetPositionMicros
– Set the time per revolution in microseconds of a continuous rotation servo. For a standard servo, 1000 is fully counterclockwise and 2000 is fully clockwise.
Parameters:
* <code>position</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) —
The new rotational speed for a continuous rotational servo.
事件
PositionWritten
– ThePositionWritten
event is run after a successful write to the servo’s position. The meaning of theposition
parameter depends on whether position update was triggered by aSetPosition
call or aSetPositionMicros
call.
Parameters:
* <code>position</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) —
The new position of the servo. If the call was positional, this will be in degrees. If the call was rotational, it will be in microseconds.