Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: Can I read/write data througth usb?What language is the best?  (Read 1080 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there, I know we can send/receive data throught usb with Serial.write and read, but this data just stay in arduino IDE and I don't like it...I'd like to build my own program for PC and make it communicate with my arduino board.

So, is it possible?What language is better?I'd prefer going with java or c# but I've no problems doing it in c++ or other...just point me out to some simple tutorial, as I don't know how to communicate with an usb peripheral in the first place smiley-sad (in arduino I just keep doing Serial.write and stuff, right?)
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to communicate directly with a usb device. The Arduino appears as a virtual serial port, and you communicate with that. Processing (http://processing.org) is Java based, free, uses basically the same IDE as the Arduino software, and provides examples for communicating with Arduino. Whether it's best depends on what you actually want to do. If you want to write something with a fancy GUI, then Visual C# or Visual Basic might be a better option, assuming you are on Windows.
« Last Edit: June 11, 2012, 05:47:48 am by dxw00d » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mh...I'd like to use a more "standard" language, so I can use code snippets I already have, avoid learning other languages and make my application more portable...isn't there a "pure java" way?
« Last Edit: June 11, 2012, 05:51:36 am by Phate867 » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Provided 'Pure Java' can access a serial port, then you should be fine.

What level of portability do you need. One of Processing's advantages is that it runs on OS X, Linux and Windows, and you can produce standalone apps for all three platforms regardless of your development platform.
Logged

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

Quote
isn't there a "pure java" way?
Look at the playground. There is a whole section on interfacing with software. Pick a language/mechanism that you are familiar with.

http://arduino.cc/playground/Main/InterfacingWithSoftware
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pure java is fine as pretty every os has a jvm installed on! smiley-grin
Could you point me to some "interact with virtual serial port" tutorial you think is useful, please?

Edit:
thanks Paul this was just what I needed! smiley-wink http://arduino.cc/playground/Interfacing/Java
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Pure java is fine as pretty every os has a jvm installed on!

If only life was really that simple, instead of the reality of 'every os may/may not have one, or more, of a set of not quite compatible jvms installed'.
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: