Provides access to Qwerk's servos' controllers.

The class allows to manipulate Qwerk's servos. The total number of available servos equals to Servos.Count.

Each servo has logical and physical positions, which may or may not be equal. Both positions may vary in the [0, 255] range. Physical and logical positions are equal, when servo's physical moving bound (range) is set to [0, 255] (see SetBound). In this case setting servo's logical position with SetPosition method results in servo's physical moving in the [0, 255] range. However, of physical bound is set to [10, 20], for example, then physically the servo will move only in this range. But logical position is still may be set in [0, 255] range, which is mapped to physical range.

Sample usage:

// get Qwerk's servos service Qwerk.Servos servos = qwerk.GetServosService( ); // stop all servos servos.StopServos( ); // set 0th servo's bounds servos.SetBound( 0, new IntRange( 10, 100 ) ); // set servo's position servos.SetPosition( 0, 50 ); // ... // get 0th servo's position int currentPosition = servos.GetPosition( 0 );
示例#1
0
 /// <summary>
 /// Get Qwerk's servos service.
 /// </summary>
 ///
 /// <returns>Returns Qwerk's servos service.</returns>
 ///
 /// <remarks>For the list of possible exceptions, see documentation to
 /// <see cref="Qwerk.Servos(Qwerk)"/>.</remarks>
 ///
 public Qwerk.Servos GetServosService( )
 {
     if (servos == null)
     {
         servos = new Servos(this);
     }
     return(servos);
 }
示例#2
0
 /// <summary>
 /// Get Qwerk's servos service.
 /// </summary>
 /// 
 /// <returns>Returns Qwerk's servos service.</returns>
 /// 
 /// <remarks>For the list of possible exceptions, see documentation to
 /// <see cref="Qwerk.Servos(Qwerk)"/>.</remarks>
 /// 
 public Qwerk.Servos GetServosService( )
 {
     if ( servos == null )
     {
         servos = new Servos( this );
     }
     return servos;
 }