User manual
Copyright © Dr Robot Inc. 2005
15
The following are some functions used in this sample application for controlling the servos mounted on
the head:
WiRobotSDK1.EnableServo 0
WiRobotSDK1.ServoTimeCtr 0, 3800, 1000
The
WiRobotSDK1is the WiRobot SDK Component ActiveX control. The first line will enable the channel
0 servo. The second line will control the servo to take 1000ms to the target position of 3800.
User can also obtain and control the multimedia information of the robot simply by calling the
following functions
WiRobotSDK1.LcdDisplayPMS sourceFileName
WiRobotSDK1.TakePhoto
WiRobotSDK1.SavePhotoAsBMP destinationfileName
The first function will change the LCD display on the robot to the image stored in the
“sourceFileName” which is in bitmap format. The second function will request the robot to take a
picture and an “ImageEvent” will be triggered when this image is ready for pickup. The third function
will save the image to the file with “destinationfileName” in bitmap format.
V.3 Sample Application 2 - WiRobot DRK6000/8000 Controller (VC++)
The second sample application demonstrates how to program a VC++ application using the WiRobot
system. The GUI of this program interface is shown as follows:
Figure V.5 GUI of the WiRobot DRK6000/8000 Controller (VC++)
To obtain an image from the robot, user can call the following function where m_ctlSDK is a member
variable of the class CWiRobotSDK imported from the “WiRobot SDK ActiveX Module”
m_ctlSDK.TakePhoto ();
To control the robot to move forward continuously, user can call the following functions
m_ctlSDK.SetDcMotorControlMode (0, 0);