Arduino101 伺服

« 返回首页

Arduino101Servo 伺服

Arduino 101 Servo 扩展程序允许用户远程控制连接到 Arduino 101 的伺服电机。

更多链接<ul><li>下载 Arduino 101 Servo 的示例项目。</li></ul>

属性

  • BluetoothDevice – The BluetoothLE component with a connection to the Arduino 101.

get Arduino101Servo1 BluetoothDevice

set Arduino101Servo1 BluetoothDevice  to

  • Pin – The Pin on the Arduino board that the device is wired in to.

get Arduino101Servo1 Pin

set Arduino101Servo1 Pin  to

方法

  • 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.

call Arduino101Servo1 IsSupported

  • SetPosition – Set the rotation of a positional servo. Valid values are 0-180 degrees.

Parameters:

 * <code>position</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) &mdash;
   The new position of the servo in degrees. Valid values are 0-180.

call Arduino101Servo1 SetPositionposition

  • 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>) &mdash;
   The new rotational speed for a continuous rotational servo.

call Arduino101Servo1 SetPositionMicrosposition

事件

  • PositionWritten – The PositionWritten event is run after a successful write to the servo’s position. The meaning of the position parameter depends on whether position update was triggered by a SetPosition call or a SetPositionMicros call.

Parameters:

 * <code>position</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) &mdash;
   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.

when Arduino101Servo1 PositionWritten position do

文档反馈