Pages: [1]   Go Down
Author Topic: Arduino + Visual Basic  (Read 1277 times)
0 Members and 1 Guest are viewing this topic.
New Zealand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
With arduino everything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone
For a project im doing i have a Visual Basic program that interfaces with the Arduino. What I was wondering is if its possible to program the Arduino using the Visual Basic program.

For example: I click a certain button in a form and it compiles a certain sketch and loads it into the Arduino.

Maybe there is a way I could make my program use the Arduino IDE in the background or something.... :-?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33271
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Simple answer is yes you can do that.
However it is probable that you will have to do it yourself. That is I don't know of any one who has written such a system although there is nothing stopping you doing so.
Logged

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

The Arduino IDE is just using the Avrdude (i think) program.

If you turn on verbose text in the IDE you can see exactly what is going on when Arduino compiles and uploads a sketch to the board.
Logged

New Zealand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
With arduino everything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies.
I turned verbose text on but I must say I find it hard to follow the compilation path. Is there not a way I could still make the IDE do the compiling and uploading form my program without opening up the IDE?
Logged

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

Not really, that would be like running a program without running it :-)
Logged

New Zealand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
With arduino everything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What actually does the compiling and uploading in the Arduino environment anyway?
Logged

Not USA
Offline Offline
Full Member
***
Karma: 1
Posts: 123
Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wouldn't this essentially be rewriting the IDE in VB? Not saying this is a bad idea, but it's a lot of work when the IDE is already there. For a custom job I think you might be able to call avrdude from VB, but you'd need to understand it properly in order to do it right.
Logged

3D Artist,Modeler, Texturer, Animator, Electronics and Robotics, Programming C, VB, Website Design, Flash animator

Too many hobbies?

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Quote
What actually does the compiling and uploading in the Arduino environment anyway?



The Arduino IDE calls the open source gcc compiler/linker for constructing the final HEX file. The IDE then calls the open source AVRDUDE for uploading the HEX file to the target board.

Lefty

« Last Edit: June 13, 2010, 08:23:23 am by retrolefty » Logged

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

If you just want your VB program to upload an already compiled program to Arduino you can skip the ggc compile / link step and just call Avrdude to upload the hexfile. Be warned though, Avrdude takes a whole bunch of parametres that absolutely has to be right. You should be able to see them in the IDE in verbose mode.
Logged

New Zealand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
With arduino everything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone and thanks a lot for all the replies.
I will indeed try to call the gcc compiler and the avrdude from vb. Do you think I cantake inspiration onthe already written java code for the Arduino IDE and if so which source files from all of the java code (http://code.google.com/p/arduino/source/browse/#svn/trunk/app/src/processing/app) is responsible for all the compilation and uploading?

Thanks again. smiley
Logged

Pages: [1]   Go Up
Jump to: