Visual Basic Tutorial 1 - Getting Started
While assumptions are not generally a good thing, I am going to start this tutorial project by assuming that the reader has a copy of VB Express and that you have at least a passing acquaintance with it and are comfortable using its IDE. If not, then please get a copy of VB Express (a free copy is available from Microsoft) and go through it's tutorials to become familiar with terms, procedures, etc. As well, I assume you have downloaded the EZ SDK from the EZ-Robot website and have installed it and know where the DLL has been put.
1.1 The first thing you need to is to get VB to recognize the EZ module. Follow these steps:
a) Start up VB with a new project; call it whatever you would like say like MyProject. It should be a Windows Form Application. This will produce a form called appropriately enough Form1. Feel free to change this name if you like as well as any of the form's properties. (See why I assumed you knew VB already!!).
b) Now we will add the EZ controls to the Toolbox. If the Toolbox is not showing then use View Other Windows Toolbox to display it. Right Click on the Toolbox. A dropdown menu should appear; select the Add Tab. A new entry in the Toolbox should show up where you can enter the name EZ-B or some other name of your liking. Now highlight the EZ-B tab and Right Click. From the dropdown menu, select Choose Items. A Choose Toolbox Items form should be displayed. Browse to where you put the EZ-B DLL from the SDK and press Enter. The Choose Toolbox Items form will now have 2 new entries; EZB and EZ_B Connect1. Select both items by checking the check boxes on the left and press the OK button. The Choose Toolbox Items form will close and the Toolbox should now have 3 new entries under the EZ-B entry. They are:
1.2 Now for your first program. Well it's not really a true program but it will actually do something and an important something as well. We will get the PC to talk to the EZ module.
1.2.1 Go the Toolbox and double click on the EZB_Connect. This will put a special EZ control on the form. This control will contain a button labelled Connect, a label which should default to Auto and another button, this one labelled Debug. You can move the control around to wherever you would like on the form, however, the top left corner is a good place for now.
1.2.2. Now for the fun stuff. Your program is ready to run. All you need to do is attach power to your EZ module and set up the Bluetooth connection. Details in the Getting Started instructions that came with your EZ module work fine. Once you attach power to the module, the LED will start flashing. Run your program by pressing the F5 key, press the Connect button and the Connect button will dim for a while. In a few seconds, the LED on the module stop flashing and the Connect button will change to Disconnect.
1.2.3. If all went well, your program will control whether or not your PC and the EZ module talk to each other. The next tutorial will actually write some code that will let you do something useful.