Arduino101 伺服

« 返回首页

Arduino101Servo 伺服

The Arduino 101 Servo extension lets users remotely control servos connected toan Arduino 101.

More Links<ul><li>Download a sample project for the Arduino 101 Servo.</li></ul>

Properties

  • 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

Methods

  • 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

Events

  • 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