Let's Make Robots!

Controlling servo with PC using Visual Basic and PICAXE 08M

i am attempting to control a servo by clicking a button on my PC. From what i understand i have to use Visual Basic. i have not used VB before and dont really understand it. i noticed this instructable http://www.instructables.com/id/Control-real-world-devices-with-your-PC/ and have tried to build the circuit many times but it just isnt working. when i open the VB program and try to connect to the PICAXE it comes up with "A first chance exception of type 'System.IO.IOException' occurred in System.dll" and a timeout occurs. any help would be appreciated. and i also have a PICAXE 20X2 if it would be any easier with that chip.

i posted a pic of the error that occurs.down the bottom left hand corner you can see the error and in the foreground form pop up it says timeout.

Will :)

 VB error that occurs

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

"From what i understand i have to use Visual Basic. i have not used VB before and dont really understand it."

Is there any computer programming languages you understand? Perhaps you don't need to use VB (not that it would necessarily be bad), I've had great success with Python, Java, and C++ so there is many ways to do what you are trying to do.  I think Python is a simple way to program serial communication between a microcontroller and computer. I'm sorry I'm not much help with VB :(

thanks for the heads up. what version of Python do you suggest for a begginner? and no sorry i havent learnt much about a particular computer programming language.

I suggest you learn Python 2 and not 3, which is what I did.  You can learn from Bucky's video tutorials to install and learn the basics of Python, and then check out his wxPython tutorials which will help you make simple GUIs (graphical user interface), but note there are also other, probably better alternative GUI APIs other than wx.  The video tutorials make learning great, although it can take some time as there are many of them.

As Chris mentioned a terminal is very practical and requires no programming at all.  If you run Windows XP then you already have hyperterminal installed, I typically use TeraTerm Pro which is free terminal software and I use it frequently.  It basically allows you to open a connection to a serial port (such as USB COM port, DB9 serial port, Bluetooth COM port, etc) and start recieving and sending characters using the keyboard.

I have already had a go with using the PICAXE terminal but cant seem to figure out the hyperterminal. how does this work?

If your goal is to simply control your picaxe with various keystrokes, you can simply use the terminal supplied with the Picaxe software itself. It is the sertxd command. If you want to go a bit fancier than that, you can use anything you want on the computer end. I personally use Processing, but you can use VB, Java, Python, etc. etc. etc.

I use the serial terminal from parallax. It is labeled as if it is for a BS2 or Propeller, but it will work with anything speaking serial. It is simple and straight forward and should be no problem to figure out. I use it for Arduino, Prop and Picaxe as well --just be sure you are on the right com port and baud rate and you will be all set.

Here is the Link

Parallax Serial Terminal v1.2.1 - (Supports Windows 2K/XP/Vista/7) <-- This is what you want.


thankyou very much chris, this was the exact thing i was looking for. a simple communication program. :)