First Test Program

Each test comprises a program that runs in the Basic Stamp 2 and a VB6 program which communicates with it.

The first Stamp 2 program I came up with is listed adjacent.

If you are using the on-board 9-pin serial connector you must specify 16 as the RX (receive) pin in the SERIN command.

84 is Baudmode (see Stamp documentation for SERIN command). mydata is the byte variable that will receive the data from the VB6 program.

Load the Stamp 2 program from the Parallax Basic Editor / Development System.

In this simple program my VB6 program sends an uppercase character A through H to switch on LEDs 0 through 7. I switch them off by sending a corresponding lowercase character a through h.

The VB6 GUI is shown adjacent. It consists of 8 option buttons in a control array (indexed 0 through 7) to simulate LEDs. The corresponding VB code is shown underneath.

As this program uses the MSComm Active-X control, I thought it would be useful to include a screen shot showing its property settings as used in these test programs.

Run the VB6 program. Click on an option button or use the horizontal cursor keys to select an LED. Notice that the last LED that was switched on is first switched off before the next one is switched on. (In this test program only one LED is lighted at any time.)

I can switch through the LEDs quite quickly. It’s possible that an even smaller Sleep duration (currently 30 milliseconds) would make the program even more responsive.

 

[Home] [First Test Program] [Second Test Program] [The Application] [Feedback]