Pages: [1]   Go Down
Author Topic: How to use Comunication Data with USB on Arduino Uno  (Read 1321 times)
0 Members and 1 Guest are viewing this topic.
Indonesia
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please help me  smiley-confuse

I've been looking for references in various places. and I have never found a way to make the program counter using visual Basic 2008 with Arduino as an input to the counter, and use usb as data communications. I use arduino uno. Do you have a solution to solve my problem?
I really need it soon.  smiley-eek-blue
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why do you insist on using VB? Visual C# is equally affordable, and makes it easy to connect to the serial port, and read and write data to/from it.
Logged

Logroño - Spain
Offline Offline
Sr. Member
****
Karma: 3
Posts: 281
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I am a newbie, but a man too old as to remember times in which, to communicate to an old RS-232 port, it was so easy as typing (in BASIC) "open "COM1" as #1 input" (or somethig similar).

Questions: ¿there exists something similar in the 21th century?  smiley-confuse

If not: ¿is there some simple code that an old programmer can use to get data form the arduino and have it in excel?

As we say in spanish: "os guardaré eterna gratitud" (I shall be grateful forever)  smiley-grin

thanks
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
there exists something similar in the 21th century?
In C#, it's nearly that simple.

Quote
is there some simple code that an old programmer can use to get data form the arduino and have it in excel?
Excel implies Windows. There is a library, and PC application, called GoBetwino, that might be of interest to you.
Logged

Logroño - Spain
Offline Offline
Sr. Member
****
Karma: 3
Posts: 281
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Pauls.

I've never used C, but I don't think that it's going a problem. The question, maybe, is about a more general subject:  "Excel implies Windows" means that using C does not use wimdows?. In other words: If I create a plain text file usin C: can I read it form a windows based app (say excel or vb program)?.

In the meanwhile I'm familiarising whit the arduino: I've tried this program:

Code:
int incomingByte = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // send data only when you receive data:
       
                // read the incoming byte:
                incomingByte = Serial.read();

                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte, DEC);
     
    }

that i've derived from one of the examples just to (try to) see the message in the monitor window. It gives an error mesagge: "No device found in COM3".

On the other hand, the arduino programming window says at the low rigth corner "Arduino Due (Programming port) on COM3". The windows hardware control panel says that the programming port is COM16 and the native port -that I've just connected- the COM20.

I feel absolutely lost (and ashamed) smiley-red

Thanks again
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

C is a programming language. It can be used to develop applications that run on a variety of operating systems, like Windows, OSX, Linux, Unix, Solaris, HPUX, SunOS, mainframes, etc.

Excel is one such application, written for one specific operating system (Windoze).

That code runs on the Arduino. It can NOT possibly display the error message that you quoted. You should avoid using pronouns like "it". Use nouns, like 'the Serial Monitor" or "the Excel application".

Quote
On the other hand, the arduino programming window says at the low rigth corner "Arduino Due (Programming port) on COM3". The windows hardware control panel says that the programming port is COM16 and the native port -that I've just connected- the COM20.
The Due has two ports - one for programming and one for serial communication. It's important to use each for it's intended purpose.

You aren't trying to have you C application program the Due, are you?
Logged

Logroño - Spain
Offline Offline
Sr. Member
****
Karma: 3
Posts: 281
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I reply myself:

The problem about te COM3 is not a problem at all: just changing the serial port to COM16 (fell ashamed again).

So the question does not remain the same but: what if I want to use the "Native" port?. Is it "serial1"?.
Can I open a window to monitorize COM20?

Thanks
Logged

Logroño - Spain
Offline Offline
Sr. Member
****
Karma: 3
Posts: 281
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pauls,

I was writing the last post while you answered the other one.

I have to learn the jargon: the message appeared on the lower -black- section of the "arduino" window -the one that allows you to edit and send code to the arduino-

Actually the code is working.

Back on the main subject (getting data form the arduino and passing it to an windows app): I have some experience on programming excel and autocad whith vb and, for the project that I'm trying to developpe, it would be sufficient if I can write a programm -using C or whatever language (or tool) easy to use- that opens the port, listens to it and writes a txt file. Although the whole system (arduino, interface programm and the app in windows) is going to work on a "real time" basis, the arduino is just going to listen to a human pressing buttons (or toggling switches), then "serial sending" the binary information; the program in the PC modifing -and closing- the -text- file every time the human switchs a switch (and the arduino informs) and, finally, the app doing something depending on the human action.

Thank you for your answers
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it would be sufficient if I can write a programm -using C or whatever language (or tool) easy to use- that opens the port, listens to it and writes a txt file.
C# is perfect for this.

Logged

Logroño - Spain
Offline Offline
Sr. Member
****
Karma: 3
Posts: 281
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK.

I'll try.

Thanks again.
Logged

Pages: [1]   Go Up
Jump to: