Write a simple program to control 10 RC servos with KMK USB RC Servos Card with Microsoft Visual C# 2008 Express.
We are going to write a simple program to control the actions of 10 RC servos. Please refer to KMK USB RC Servos Card manual for details operations.
Step 1 - 2 need to do once on your computer. Just skip steps 1 - 2 if you have done it already, .
Step 1 Install Visual C# 2008 Express.
Step 2 USB Driver installation.
Step 3 Install KMK USB Servos OCX.
Step 4 Load KMK USB Servos OCX into C#.
Step 5
Make sure you have attached the IO card to the PC and the OCX is on the form. Then you should see the serial number of the card on the status window as below;
Step 6
We are going to write the code for automatically connecting the IO card while the program is started. Double click on the empty space of the form to enter into the code page. Type the code as below;
Step 7
Now choose Button from the ToolBox and put two on the form.
Step 8
Double click button 1 and type the code as below;
Step 9
Double click button 2 and type the code as below;
Step 10
Run the program and observe the movement of the servos. Click the 'Start Debugging' button on the tool bar or press F5 to run the program.
Note: You can connect more KMK USB Servos Card together to control more servos. Of course, you'll need to put same number of ocxs on the program to control them.