How to roll-your-own serial control software for the Mini SSC II Serial Servo Controller

 

Note: Some of the larger graphic files on this page have been reduced to thumbnail size for faster page loading. To view a larger graphic - simply "click" on the image.

 

This article will give you a behind the scenes look at how to build your own serial interface using Microsoft's Visual Basic 5 Pro. We will focus primarily on designing a serial interface for controlling the Mini SSC II Serial Servo Controller manufactured by Scott Edwards Electronics Inc. The Mini SSC has been around a while and is probably one of the most useful little gadgets to hit the electronics scene for quite some time now. My past articles for controlling hobby servo motors received such a fantastic response that I decided to do a special article here that would show you the details of building your own custom serial software. The ability to design your own serial interface software is easier with today's technology than ever before. The ability to really take charge of Scott's Mini SSC's will give you a big edge over your competition when you're building that next robot also.

 

As you can see from several of my past articles here, a serial interface from your PC to a microcontroller can add enormous power to any project. By combining the microcontroller together with your PC you can take advantage of the processing power of two systems combined to really pump-up and enhance your projects. This application will give you complete control of the Mini SCC II Serial Servo Controller, and provide you with a good understanding of the basics of serial communications software development. Some of the most powerful designs you'll see on the market take advantage of serial interfaces to the PC. The PC interface offers quite a few advantages that often may not be available in conventional stand-alone microcontroller products.

 

Using Microsoft's Visual Basic 5 Pro, this article will walk you through each detail of constructing your own custom serial control software. If you own an older version of Visual Basic you'll need to upgrade to at least version 5 Pro. The Pro version comes with the MSComm control from Microsoft that makes serial applications programming extremely easy. Here's a screen capture of what your finished project could look like.

 

 

Mini SSC II Servo Control Software

 

My past articles for controlling hobby servo motors focused primarily on using different types of microcontrollers such as the Basic Stamp and PIC16F84 to control servo motors through a serial interface to your PC. This article will take you to the next level by showing you how to design your own serial control software, to interface directly to the Mini SSC Servo Controller.

 

About the Mini SSC:

 

Using the Mini SCC II you can build a superior servo control system with the capability to control up to 16 servo motors simultaneously. If you're a real motor hungry maniac and want to build that 500 pound contest bashing robo-crusher, you can order more Mini SSC II's programmed with a different range of addresses. You can then chain together up to 32 Mini SSC II's for controlling a whopping total of 255 servos. Remember, that's 255 servo motors that you can control (using a single serial connection). Just imagine the animatronic monster you could create with 255 servo motors...!

 

What makes the Mini SSC II such an outstanding bargain is its excellent price together with the ability to accept serial commands and position servo motors simultaneously. Using the Mini SSC gives you a considerable advantage over older more time consuming servo control methods. The Mini SSC reduces the processing overhead that would normally be required by the central processor or microcontroller to maintain servos in a desired position. The Mini SSC only needs to be told once where to position each motor. It will then maintain each motors position by repeatedly sending pulses to each motor that correspond to the last requested position. I won't try to rehash Scott's manual for the Mini SSC controllers, if you don't have one you can grab a couple of them right now by visiting our online store HERE.

 

OK, now that you have yourself a Mini SSC II controller we're ready to start the article. Using Microsoft's Visual Basic 5 Pro makes building your own serial control software an easy task. I'll show you screen captures of the project as I walk you through building your own serial application. Here we go...!

 

Step 1:

 

Start Visual Basic. You should see a screen similar to the one below come up when you first start VB-5 Pro.

Since we will be designing a standard executable file, click on the Standard EXE icon to bring up the main programming screen in VB.

 

Step 2:

Next you'll be presented with a standard (blank) form in the work space. This will be the form that we eventually turn into our completed application just like the first screen capture you saw at the top of this page. If you look just above the blank form you'll see the toolbar. Notice on the toolbar that we don't have the Microsoft Comm Control 5.0 symbol on the toolbar yet. The Comm Control 5.0 will be an icon that looks like a small yellow phone. Here's what the toolbar normally looks like when you first start Visual Basic.

 

If you don't see the Comm Control element on the toolbar yet don't worry, it's simple to get it up there. Follow the steps outlined below.

 

1. On the menu bar at the top of your screen click on Project.

2. Scroll down and click on Components...

3. On the next screen that pops-up scroll down until you see Microsoft Comm Control 5.0.

4. Place a check mark in the box to the left of Microsoft Comm Control by clicking on the box.

5.. Next click Apply at the bottom of that screen, then click OK and the box will close.

 

 

Now you should see the small yellow telephone symbol on the toolbar. This indicates that you're now able to add the Microsoft Comm Control to your project. If your toolbar doesn't look similar to the one below, repeat steps 1 through 5 until you see the small yellow phone icon. To complete this project you must have the Comm Control element on the toolbar as shown below.

 

 

Note: Sometimes the toolbar will reside on the left side of the screen. This is common and it's ok. If you have the Comm Control icon on your toolbar, you're ready to start building the project and add the Comm Control to the blank project form.

 

Step 3:

 

Place your mouse over the Comm Control icon on the toolbar and click on it to select the control. Next place your mouse over the lower left (grey) area on your blank form. Click & hold the mouse button down while dragging the mouse down to the right. Release the mouse button and a small yellow telephone should appear in the lower left corner of your form just like on the form shown below.

 

 

Doesn't look like much yet does it...? Don't worry, you're almost there. Next we need to add a few scroll bars to our blank form. The scroll bars will used to control the servo motors. Refer to the screen capture above of the toolbar. Just to the left of the timer control, (a small icon that resembles a stop watch), you should see a vertical scroll bar. Click on the vertical scroll bar to select it just the same as you did for the Comm Control. Now move the mouse down to your form on the left side and click & hold the mouse button down while dragging the mouse down to the right. Now you should see a single vertical scroll bar on your form once you release the mouse button.

 

When you click on a control icon in the toolbar you select that specific control element. Clicking and dragging your mouse on the form will place or (draw) that control on your form. By holding down the mouse button and dragging before you release, you place and re-size the individual controls on your form. For the remainder of this article I will simply tell you what control to select and you'll do the rest by placing the controls onto your form.

 

Keep placing vertical scroll bars on your form until you have a total of (8) vertical scroll bars side by side like the following.

 

 

 

Hey, wait a minute... Your form is bigger than mine..! Don't bail out on me yet, here's how I made it bigger. Click on the outer edges or the flat grey area of your form to select it and adjust the size. Notice the screen capture directly above. The small black squares indicate that you can click and hold your mouse button over the squares while dragging the form to re-size it. Go ahead and experiment with re-sizing everything. Once you're finished, build your form to look similar to the one above.

 

Now we have a project that almost looks like it can do something. Not quite yet, we still have a ways to go. Next you need to add a few command buttons. The command buttons associated with this project will perform the following functions:

 

1. Send data to the Mini SSC II to center the servos.

2. Change the text in the text boxes above each scroll bar.

3. Move the scroll bar position indicator to the middle.

4. Exit the application.

 

Step 4:

 

Adding command buttons is just as easy as the scroll bars. Just to the left of the small white box with a check mark inside it on the toolbar is the Command Button control. Use this the same as you did the scroll bar tool to add (9) command buttons to your form. Place one command button below each scroll bar. Then place one more command button in the middle of your form near the bottom. To change the text on each command button follow these steps.

 

1. Click the first command button on the left side of your form under the first scroll bar.

2. Look to the right side of the screen you will see a long menu like the one shown below.

 

 

Control Properties Box

 

Click on the area inside the properties box marked Caption. Notice from the picture above that just to the right side of the highlighted area you see the word Center. If you haven't done so already click your mouse in this area. Delete whatever else is there and type the word Center into this area. Now look at your form. See how you just placed the word Center into the first command button below the first scroll bar..? That's how you put text into each of the remaining command buttons. Go ahead and do the rest of your command buttons below each remaining scroll bar. When you're finished assign the last command button in the lower center of your form as the Exit button. Change the text on the last button to read Exit.

 

When you're finished your form should (hopefully) resemble the one shown below, with a total of (8) scroll bars and (9) command buttons.

 

 

Project Showing Command Buttons

 

Step 5:

 

In this phase of the project you're going to add some text boxes. The text boxes will give you a way to see the actual values of the scroll bars, and will contain the actual data that we will send out the serial port to the Mini SSC controller. In the code section of this article I will explain just how this works. For now just place (8) text boxes on your project form as shown below.

 

 

 

Now you should have a project form that resembles the one above. Just the same as in the previous example, you can now change the text inside each of the text boxes by first selecting a text box and then making changes to the properties box on the right side. Select text box 1 on the far left. Now change the text property for text box 1 by scrolling down in the properties menu until you see a selection marked Text. To the right of Text you should see Text1. This is the text that you'll see inside text box 1. Simply click in this area and delete all of the characters until this area is blank. You don't want anything in the text boxes until the code you're fixing to write sends it there. Select each of the remaining text boxes and erase the text property of each box so it will be blank. When you're finished, each text box above all of your scroll bars should be blank. If not, go back and try it again until they're all blank.

 

Selecting Text Color:

 

The properties box on the right side of your screen lets you make changes to the various properties of each control you place on your form. By clicking on the text boxes you can then alter the default properties of each one. To change the colors simply change the default settings in the properties menu for the items BackColor and ForeColor.

 

ForeColor will change the color of the (text) and BackColor changes the color of the area behind the text. You can experiment with color schemes until you're happy with your own design. Once you have selected the text and background colors you're ready to move on to the next phase of this project.

 

Step 6:

 

Adding the Menu. This project uses a menu located at the top of the project form to let the user select different serial ports. Not every person that uses your software will have the same serial ports available, so it's always a good idea to offer them a means of selecting different ports. In most cases different baud rates are necessary as well, however for this project we will fix the baud rate at 9600.

 

To add a menu to your VB project follow these steps.

 

1. Click on the main form to make sure it is selected.

2. From the top menu select Tools.

3. Scroll down to Menu Editor and click on it.

 

You should see a screen similar to the following picture with the exception that yours will be blank. Don't worry I'll show you how to fill it in so yours looks just like the picture below.

 

 

Menu Editor Screen

 

In the first box type Select ComPort. Below beside Name: type mnuSelectPort just like you see in the above example. The Caption will be what the user sees as the menu on the top of the form. Now click the button marked Next just above the white window on the bottom of the menu editor screen. Next type in Com1,9600,N,8,1 beside Caption. Notice as you type that the text you're typing shows up in the larger white screen just below where it says Select ComPort highlighted in blue. If you don't see four periods before this entry like this ....Com1,9600,N,8,1 then click the arrow pointing to the right. Make your entry look (exactly) like the sample above in the picture. The periods make the other menu items "sub menus" inside the main menu selection.

 

In the box marked Name type the following. mnuCom19600. Now repeat this same procedure for the next menu item. Click next and type in next to Caption: Com2,9600,N,8,1. Below this next to Name: type mnuCom29600. You should have the exact screen as the one shown above. If you do, you're ready to move on. If not, keep going until your menu editor box looks (exactly) the same as the one above.

 

Step 6:

 

Here is where we assign our basic code to each of the controls we placed on our main form. Without writing the code for each control, our project will just sit there on the screen like a big fancy, "stupid" graphic. Even if you click a command button or move a slider, nothing happens. This is where we tell each control on the form exactly how we want it to act by coding instructions into each one. This is the area that most beginners with Visual Basic will have the hardest time. Learning to design really nice looking forms is simple. Learning how to actually make the project (do something) is another story. Don't be intimidated by the code part because you're about to find out just how simple the entire process is once you get started. So if you need to take a smoke break or grab some coffee now's the time. When you get back I'll show you just how easy it is to pull everything together and make this project come to life.

 

Form_Load

 

When the main form is loaded or run in a VB application it's sometimes desirable to have some basic code run at load time to make certain configurations. For this project we will tell the form to run the basic code that will perform the following functions.

 

1. Set up our Com Port operating parameters such as 9600,N,8,1

2. Select which port to use. i.e. com1 or com2.

3. Make the com port available or "Open the port for use".

 

To enter the code for the Form Load event, double click on a blank spot on the main form. A window will open up similar to the one below, but yours will be blank between the Private Sub Form_Load( ) and End Sub. Visual Basic is now ready for you to type in your VB Basic code.

 

 

Code Window View for Form_Load Event

 

Type in everything between the Private Sub Form_Load( ) and End Sub exactly as shown above. Notice that when you double clicked on the form the code view screen came up with the Private Sub Form_Load( ) and End Sub already typed for you. This will be the case each time you double click on any control item you place on your forms. Without going into a complete Visual Basic lesson here, just remember this point.

 

After you have verified that your code for the form load event looks exactly like the example above, click on the form again. The form will come to the front and the code windows now takes a position behind the form.

 

Here's a full breakdown for each line of code in our Form_Load subroutine.

 

Private Sub Form_Load( )

MSComm1.Settings = "9600,N,8,1" ' Baud rate=9600, No parity, 8-bits data, 1 stop-bit.

MSComm1.CommPort = 1 ' We will be using Com1 as the default com port.

MSComm1.PortOpen = True ' Open the port for use.

End Sub

 

Pretty simple don't you think? This is why you want the VB 5 Pro version. The MSComm Control is very simple to manipulate and it just doesn't get any easier than this folks. This little tidbit of code has actually accomplished quite a bit when you compare it to older programming methods that took considerably more time and effort. There are other ways to do the same thing, even with other versions of Visual Basic, however, I won't go into that for this article. If you're really interested I will provide a further study recommendation at the end of this article that will direct you to some excellent books that will detail many different options for using the PC serial port and various software to use. For this project, let's just get you going on your own control project.

 

Scroll Bars:

 

Now that we have set up our default com parameters using the Form_Load event, we need to make our scroll bars do something. The scroll bars actually have a couple functions to perform for this project. Here's a run down before we get started assigning code to them.

 

1. The scroll bars give us a device we can manipulate with the mouse that will create the servo position data.

2. The scroll bars let us change the data to be sent to the Mini SSC by sliding each bar up or down.

3. Each individual scroll bar will send a unique number to the Mini SSC to address individual servos.

 

The actual value of each scroll bar will be visible in the text boxes above each bar to provide us with a visual representation of the data that is being sent out the serial port to the Mini SSC. Each time you move a scroll bar several things happen. The text box directly above the scroll bar you move, will show you the "exact" servo position data that is currently being sent through the serial port to the Mini SSC. The scroll bar will also inform the Mini SSC as to what servo you want to move. Let's go ahead and dive right into the code for the scroll bars. This should help you understand how we can accomplish so much by simply moving that silly bar up & down.

 

Place your mouse over the first scroll bar on the left side of your project form and click (only once) we just want to select the first scroll bar. Now take a look at the properties menu on the right side of the project window. If it isn't visible already, scroll down until you come to the properties setting that says Max. Directly below Max you should see Min. This area lets us set the Maximum and Minimum values for the scroll bar.

 

Before you go any further take a moment and refer to the instructions that came with your Mini SSC II controller. Notice that the Maximum and Minimum values you need to send to the Mini SSC for the position data (byte 3) are from 0 to 254. This is the information that the scroll bar will produce for us when we move it up (Min), or down (Max). Now that we know this, lets assign the Max value for the first scroll bar a value of 254. Now make the Min value 0. If you're a rebel and you hate being told what to do, that's fine, you can change these values around. If you swap these values, you will cause the movement of the scroll bars to reverse the operation of the servo motors when you move them. Either way is really OK. Some people may consider it more appropriate that Max be placed at the top, and Min at the bottom. Just like the Burger King commercial, (have it your way), the project will work either way... Before you proceed to the next step, assign these same values to (every one) of the remaining 7 scroll bars.

 

Next look in the properties box while you have a scroll bar selected. Look for LargeChange and SmallChange. Change the default values of each one to a 1. This will give you (very) precise control over each servo motor when you click and hold your mouse on the up or down arrows of each scroll bar. You will see the effect once you run your finished project. Set each scroll bars LargeChange and SmallChange values in the properties box to a 1.

 

The Scroll Bar Code

 

Double click on the first scroll bar on the left side of the project form. The code window will pop-up again and you should see something like below, of course yours will be blank between Private Sub VScroll1_Change( ) and End Sub.

 

 

Code Window View for Scroll Bar Controls

 

Here's what takes place when you move the scroll bar up or down. When you move the bar up or down you cause a change, hence the subroutine name VScroll1_Change(). The code in this routine is activated each time you make a change to the scroll bars position.

 

Note: Pay close attention to each of the code modules above. Do you see how each scroll bar sub-routine affects only the text box above it. Notice how the routine Private Sub VScroll1_Change() affects (only) the Text1.Text. Also take note that scroll bar 1 only sends out the Chr$(0). This is because scroll bar 1 sends the information to the Mini SSC to command servo #1. If you're confused here take a quick peek at your Mini SSC manual. See where byte 2 (servo #) starts at 0..? This is the code for servo #1 that the Mini SSC expects to see if you're addressing the first servo motor attached to the Mini SSC. Now take a look at the second scroll bars code. Do you see what we're doing here..? Each scroll bar sends out:

 

1. The required (sync) byte that the Mini SSC waits for.

2. The (servo #) that we want to move.

3. The value stored in Text?.Text. The value in Text?.Text is the position data that must be sent to the Mini SSC.

 

Pay (very) close attention to this order when you enter the code for the individual scroll bars and command buttons. If you get these wrong you will be addressing different servo motors, different text boxes, etc... The values in each text box are important because it's this value that our project will send to the Mini SSC for the servo position.

 

Private Sub VScroll1_Change()

Text1.Text = Str(VScroll1.Value) ' Send the value of the scroll bar (0 to 254) to the text box.

MSComm1.Output = Chr$(255) ' Send out the (sync byte) required by the Mini SSC.

MSComm1.Output = Chr$(0) ' Select servo #1. Remember, the servos are numbered 0-7.

MSComm1.Output = Chr$(Text1.Text) ' Send the value in the text box (position) to the Mini SSC.

End Sub

 

Pretty dog-gone easy huh..? Actually there is a lot going on here, but Visual Basic isolates you from all the gory details and makes the whole thing super simple. Are you starting to feel like you can tackle the world with VB yet..? Well hold on. What's this VScroll1_Scroll( ) thingie down below...?

 

Scroll back up just a few lines to the picture of the (Code Window View for Scroll Bar Controls). See the right side white box that says Change..? Now look to the left and notice the box that says VScroll1. Thought that was just there for decoration huh..? Well the left windows shows you the control you're presently writing code for. The window on the right side tells you what (event) you're writing the code for. To enter the code for the VScroll1_Scroll( ) routine use the drop-down menu to select Scroll from the top right box in the code window. Make sure the left side box has VScroll1 in it.

 

A simple scroll bar will only show you its changed value once you let go of the mouse. So without telling the scroll bar to update its value immediately we will have to wait until we release the scroll bar slider control to see its actual value in its associated text box. This is an undesirable factor for this type of project. We want real-time updates to be visible, and we also want real-time information to be sent immediately to the serial port.

 

What the code below does is cause the text box contents to be updated immediately when you drag the scroll bar. If you are building this project yourself, try commenting out the code below and watch the effect it has on how your Mini SSC controls the individual servos. Also take note of how the text in the text boxes updates. See what happens...? You will replace the code below quickly no doubt. Try experimenting with this a little to get a feel for how it works.

 

Private Sub VScroll1_Scroll( )

VScroll1_Change

End Sub

 

Now, do the exact same thing for the remaining (7) scroll bars. Each scroll bar should have the same code for its scroll and change events with the exception that different scroll bars will send out different servo numbers (byte 2) and will affect different text boxes as I showed you above. When you're finished move on to the next section.

 

Step 7:

 

Here we are going to ad some basic code to our command buttons. Eight of our command buttons will do nothing but send the command to the Mini SSC to move the servo to its center position. The last command button marked Exit will close the com port and exit the program.

 

For now, lets enter the code for the (8) command buttons that will command the Mini SSC to position each corresponding servo to its center position. Below is what you should see in the code window. Yours will be BLANK between the Private Sub Command1_Click( ) and End Sub. Just type your code in between them as shown below.

 

 

Code View Window for Command Buttons

 

Note: Your command button will contain the following unless you have changed the names of each command button in the properties window.

 

Private Sub Command1_Click( )

 

End Sub

 

In the screen capture above you will notice that mine looks a little different. My code window shows the cmdCenter1_Click( ) instead of Command1_Click( ). Once you get a little more programming time under your belt you'll want to assign more descriptive names to buttons and any other controls you want to easily recognize. If you want to make your command buttons more descriptive and not just go with the default names VB assigns to each button when you place it onto your form, use the properties windows on the right side to change the Name of each button before you start writing the code for the button. If you change the Name of a button (after) you have written the code for that button, you will need to make the changes in your code to reflect the name changes. It's best to do this prior to starting your code. It can be frustrating debugging some large programs.

 

To begin entering code for each command button, just double click on the first command button on the left side of the project window. The code window will pop-up just as before. Make sure you type in your code exactly as shown above in the picture.

 

How the Command Button Code Works

 

Private Sub cmdCenter1_Click( )

MSComm1.Output = Chr$(255) ' Send out the (sync byte) required by the Mini SSC

MSComm1.Output = Chr$(0) ' Send out the (servo #) to address.

MSComm1.Output = Chr$(127) ' Send out the value of 127 to center the servo.

Text1.Text = Str(127) ' Update the text box with the value 127.

VScroll1.Value = Text1.Text ' Move the scroll bar to its center position.

End Sub

 

Take you time here and try to understand how & why each line of code functions. Notice here also that you can send the scroll bar to a specific position by simply assigning a value to it. The line VScroll1.Value tells the scroll bar to send the horizontal position marker to the center. Since we have set the scroll bar Min Max values to 0-254 respectively, assigning any value within the scroll bars Min Max limits will cause the scroll bar indicator to move to that exact position. Pretty handy don't you think..?

 

The MSComm1.Output command causes the serial port to output whatever value follows the Output command. In our case we are sending the information out as three separate values of strings. Refer to the Mini SSC II manual for information concerning how you need to format data before you send it to the Mini SSC.

 

Quiz: Try changing the line Text1.Text = Str(127) to read Text1.Text = Chr$(127). Now run your program. What happened..? See if you can figure out why it doesn't work right. Hint: Use the online help included in Visual Basic 5 to see what the difference between Chr$ and Str is.

 

The Dreaded Exit Button

 

The Exit button is really very simple to understand. It exits the program right..? Well if you guessed that you're half correct, but there's one more very important thing that the Exit button does in conjunction with simply exiting the program. Here's the code for the Exit button. See if you can guess what it does besides just ending the program. Remember, your command button for Exit may say private Sub Command9_Click( ) since it should have been the 9th button you added to the form and Visual Basic assigned it the (default) name. Browse back up again if you forgot how to change the name of your button. Hint: The properties window....

 

Private Sub CmdExit_Click( )

MSComm1.PortOpen = False

End

End Sub

 

 

Did you get it..? If you guessed the following, you were right.

 

1. It closes the open com port.

2. It exits the application.

 

It's important when you exit any serial communications program that you (close) the port you opened. There are ways of checking to see if a com port is actually open first and then close it if it has already been opened. Here would be one way of doing it.

 

Private Sub CmdExit_Click( )

If MSComm1.PortOpen = True Then

MSComm1.PortOpen = False

End If

End

End Sub

 

Pretty simple don't you think..? The first line says if the com port is open (true) then proceed to the next line in between the IF statement. This allows you to check first to see if the com port is actually open (true). If it is, close it, (false). Really a no-brainer, but very effective nonetheless.

 

Step 8:

 

The next step is to assign some code to our menu options. The menu for this project is very simple. The only thing we do with our menu selections is offer the user the option of changing the active com port. To start entering our code for the (2) menu selections we need to click on the first menu selection marked: Com1 9600,N,8,1.

 

Click on the main menu at the top of the form marked: Select ComPort. Roll down on top of the menu selection marked: Com1 9600,N,8,1. Click on it. The code window will pop-up with the following subroutine header: Private Sub mnuCom19600_Click( ). Below this you'll see the normal End Sub statement. In between these we need to type in the following code as shown below in the picture.

 

 

Code View Window for Menu Settings

 

Notice above how we use the IF THEN to detect if the port is already open first..? We need to do this in case we had previously selected another port and because of our Form_Load routine that defaults to Com1 9600,N,8,1. If we had another port open, it is closed and then reopened as another port. Suppose we were using com1 and wanted to change to com2..! This would allow us to change our previously selected com port.

 

There are instances where you may have two com ports available and this wouldn't really be necessary. Try to do it anyhow, it's good programming practice to never assume anything. Always CYA with code if at all possible. If you're really new and can't figure out what the CYA means, send me an email and I'll let you in on that one.....;o]

 

Also take note of the subroutine names. Remember when you assigned the names to each menu selection..? This is where the names come into play. Refer back to the menu part of this article if you're a little fuzzy with this one. Type in the code for the first menu selection. When you're finished with the first one return to the main form and click on the second menu option. Enter the second code set for that menu option. Viola...! You're almost finished with your first big-time VB serial communications application.

 

Finishing Touches

 

Here's another picture of the completed application we just walked through. Your version will look somewhat different than this one because we never placed any Frames or Picture Boxes on the main form.

 

 

Finishing Touches

 

By selecting Frame from the toolbar you can place frames around individual controls to spice up the project a little. The dark grey areas beside the Exit button are made by selecting the PictureBox control on the toolbar and then using the properties box to set the BackColor of each one to a dark grey. You can experiment with designing your own look or try to make yours look like mine.

 

To make a different icon appear in the top of your form like the blue arrow on mine, click the main form to select it. Next move to the properties box and scroll down to Icon. Click in the Icon box to open a selection window. You will need some small icons to use for this one. If you're using Visual Basic 5 pro you should have a pretty big selection of icons that came with VB 5. Just select one you like and you're done. Either way, the project works outstanding. It doesn't really include any bells & whistles, yet it's very effective for the purpose it was designed for.

 

Use this article as a starting point to build your own serial control software for the Mini SSC II Servo Controllers, or download the full version here. Like all the other projects here, if you have any questions, comments, or you just feel like yelling at me, I can be reached at: Webmaster@rentron.com

 

IMPORTANT NOTE: Microsoft screwed up with the early release of VB 5 Pro. If you get an error message saying you don't have authorization to use the MSComm Control when you try to select it from the toolbar, you'll need to download and install the fix. I have included the fix HERE for those of you having trouble registering the MSComm Control. Download and install it to clear up the errors and you'll be ready to go with the MSComm Control. It's only a 35KB file, it downloads fast and it works. HERE is another link to the Microsoft Developers web site for even more goodies that will help clear up {even more bugs} in VB 5 Pro.

 

Click HERE for the full-blown version of this project in ZIP file format. This file contains the complete installation program to set up & install the Mini SSC II Servo Control Software on your PC. Click HERE for the actual Visual Basic 5 files to Roll-Your-Own. These are the files shown in the screen captures throughout this article.

 

Further Study Recommendations

 

If you (really) want to get the inside info on developing your own custom serial interfaces, check out Jan Axelsons (excellent) book Serial Port Complete. Jan takes you through the complete evoloution of developing your own custom VB applications with a strong focus on the Serial Port and interfacing to microcontrollers. For the Basic Stamp lovers out there, there simply isn't a book on the whole planet that comes close to Scott Edwards Programming and Customizing the Basic Stamp Computer. when it comes to (complete) coverage of the Basic Stamp. Scott's book covers both the BS1 and BS2 and includes tons of great projects and sample code. If your using the Basic Stamps and you don't own this book, you're missing the boat. I Most Highly Recommend both of these books for any engineers bookshelf. You can click either one of the blue links above and shoot straight on over to the Best BookStore in the world to grab your own copies of both books.

 

Reynolds Electronics is now a distributor for Parallax Basic Stamps and other excellent products. Visit our new Basic Stamp online store HERE. We also have the Scott Edwards Mini SSC II serial servo controllers HERE.

 

PicBasic Projects:

 

Check out our new PicBasic Project Section for a large variety of complete projects, and see how easily you can create your own controllers for the Mini SSC II serial servo controllers.

Don't own PicBasic yet..? Click HERE for our special offers on PicBasic & PicBasic Pro.

 

 

 

 

Related Page 1 | Related Page 2 | Related Page 3