Go Down

Topic: Visual Basic? (Read 1 time) previous topic - next topic


Hello, I am new and waiting on my Arduino board to arrive. Continuing research in prep to getting my board, I was wondering if you can use Visual Basic to interface to the board instead of C or C++. As anyone ever tried? Is it possible? I am much better at Basic than C.




I have never tried it and I never used basic again since the Commodore64, but you can use every programming language to talk to an Arduino as long as it knows how to talk to a serial port. .NET2.0 has the SerialPort-class so VB should work.
(You don't want to write sketches for the Arduino using VB, do you? We are talking about exchanging data with a running Arduino-sketch don't we?)



If you want to use Basic on the Arduino then you cant. Get a PIC.

C is a far better language.
It will make you a better programmer and its actually easier in the long run.


Yes, you can use VB to interface to the Arduino via the serial port.


You have to do it differently depending on the version of VB.

in VB 6.0 (before .NET) you use the seriel comm. component this is the easiest way.

in VB 2005 (the newest .NET version) you use the system.io.ports.serialport class

in VB 2003 (the "old" .NET version) you are in trouble.  The system.io.ports.serialport class is not there, so the only way is to use the VB 6.0 component but this requires some fairly hairy marshalling and what know i.


I just read your post again. If you want to program the Arduino board with VB the answer is no that is not possible.

You can write a PC program in VB that can communicate with the Arduino board over the serial port. But VB code will not run on the Atmega  processor on the Arduino board.


Thanks Everyone,
The board I ordered I plan to use the USB port. So it is interesting. I do have Visual Studio as the version of VB. The one comment about using C is most intriguing because I believe that is a good answer, but since I am more familiar with VB I am not sure I am up to the new language. My dilemma would be if things don't work when programming in C it creates a double edged sword to trouble shoot Did I program wrong or is there a hardware issue? My goal is eventually to us the Arduino board to interface my PC to a model railroad I want to build.

Thanks again for the thoughts about VB.


In visual studio .net the difference between VB and C# is not very big. Of course come code constructs are not the same, but all the .net related stuff is allmost identical.

Just for the record - remember that the USB port on the Arduino is really a serial port. In your PC program it will show up as a "virtual" COM port named something like "USB to serial..."  

Go Up