Pages: [1]   Go Down
Author Topic: Visual Basic?  (Read 869 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Thanks...

 :-/

Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
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?)

Eberhard
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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..."  
Logged

Pages: [1]   Go Up
Jump to: