programming language to use on a computer closest to Arduino?

This is a pretty broad question, but basically I have been working on a project involving GMlan communications using an arduino to read and send some commands.. During the prototyping and monitoring of the bus I have mainly been using putty or hyperterminal and then I have written code for the arduino to send the commands I want and look for and send back or respond accordingly.. I have made progress, but..

What I want is to be able to write code and have it run on my computer directly.. I know this is an arduino forum, so it is kind of off topic and for that I apologize.. My final version would be run from an arduino..
For the basis of prototyping I just want to remove the middle man temporarily..

If I wanted to run code on my computer to communicate over the serial port to my canbus adapter and autorespond or try different commands and look for a specific response which language would have the smallest learning curve??
As I understand Arduino uses C and C++? yet most of the examples use Processing to link to an arduino.. I have researched it a little, but I thought I would pose this question here before I started out on my own..

Any ideas? I think I might try Processing, but it seems more graphic 'intense' than what I need.. If I can just set up something like Serial.print for feedback, specific key presses for certain commands, and some loops polling for some data responses, etc I would be happy..

Running windows 7, 64 bit on all my systems, I do have an Ipad, but do not wish to even attempt that.. its fun to play with, but thats where that ends for me, Thanks everyone!!!!! Tom

nothing really ... people like to cite processing thanks to the Firmata libraries, but yea I find it to be a pretty big pain to get anything done

I have written stuff from qbasic on a ms dos machine (qb64 is a modern alt) to C# and there's always a pain somewhere

You haven't said if you have any experience of programming on the PC. If so what language have you used? Whatever that is it's very likely it will be able to send and receive stuff to/from an Arduino.

Common languages that spring to mind are Visual Basic, Visual C#, Python or JRuby (which sits on top of the Java system). They all access the Arduino over USB by "pretending" it is on an old-fashioned serial connection.

Personally I use JRuby on Linux, but it will also work on Windows, though it may need some different stuff to access the "serial port". I think I got a serial-port app working on Windows using RXTX (which I use on Linux), but it was some time ago. The beauty of JRuby is that an app can be ported to a different computer with almost zero effort.

...R

By the time you have located, installed, configured and learnt how to use something else it sounds to me as though you might just as well use the Arduino itself. In any case you will not actually be proving that your program works with an Arduino unless you actually use one.

There are Arduino emulators available that run on a PC but you will need investigate what they are capable of.

Thanks for the suggestions, sorry I didn't think to specify that my programming abilities is pretty much just the Arduino nowadays.. No actual schooling, just self taught, I don't mind learning, I just didn't want to learn something and find out it was the most difficult and incorrect lauguage for what I wanted.. I had some classes in school but that was just the basics and a very long time ago, lol.. I got bored last night and downloaded and started experimenting with Processing.. The syntax is very similar and I seem to be working ok with it.. There is a Serial library and I can just use a println for output to the screen.. Already found keyPressed() as well for specific commands as I need them.. I think Processing will work out just fine..

I had been using the Arduino for the middle man, but it was getting to be a pain to add or change a PID, then re-upload everytime and reconnect to the vehicle.. I was using a keypad and lcd for feedback but it was slow.. This way I can use my bluetooth elm327 I had modified for pin 1 GMLAN and run from my bench for experimentation and prototyping.. Hope it's a lot faster..

Thanks again, but I think my question is moot now, unless someone tells me otherwise I'm going to run with Processing.. Only annoying thing at the moment is the little box that comes up every time I run a sketch.. I'm not using it for output but it's still there, lol.. I can live with it for the limited time I will be doing this, heck maybe I'll make up some sort of GUI if I feel the need.. Tom

Only annoying thing at the moment is the little box that comes up every time I run a sketch..

Please explain more. I have never seen a little box come up when writing Processing code that talks to the Arduino.

Grumpy_Mike:

Only annoying thing at the moment is the little box that comes up every time I run a sketch..

Please explain more. I have never seen a little box come up when writing Processing code that talks to the Arduino.

Well, my guess is anytime your running processing your looking for output on the screen in the form of a window.. Well I'm not writing or putting anything in the screen, I'm just using something like

println("Resetting ");

That displays on the bottom of the processing program, just like a serial output.. I am just sending outputs there for feedback, I haven't tried yet, but I hope I can send data I receive that way was well.. I have no need for a fancy window with special fonts or graphics.. Hope I explained that well enough, I'm learning as I go... Tom

You might get by with a C or C++ compiler for the command line (cmd.exe) window in Windows. Something like "mingw", probably.
I guess in theory it would be possible to implement some of the Arduino libraries (Serial.print(), millis(), etc), and maybe even wrap the IDE around it, but it would probably be more beneficial all around for users interested in such things to learn the basic desktop/linux io calls. If your IO is pretty much limited to reading and writing to a dumb screen, you won't need to learn very much.

If you want to run code on a PC that you can also run inside an Arduino sketch then IMO it makes sense to separate your code into the core logic that handles communication protocols etc, and a shim layer that interfaces with the local hardware and runtime framework (read/writing a serial port, reading the current time etc). Then you can use one shim supporting Windows for your PC-based testing, and another shim supporting the Arduino runtime framework for when you run it inside a sketch. The whole thing would be written in C++, and the core logic would be designed to be platform-neutral and compiler-neutral.

I'd question whether it was worth the effort to do that, though, since anything you run on an Arduino is likely to be very small and simple and not IMO justifying the effort required to port it to run on a PC for testing. Why not just do your development on an actual Arduino?

Thanks for the suggestions..

I'm not trying to write code that will run on both, I was simply looking for what was closest to what I'm used to(arduino) in attempting to make/write a program on the computer for testing and debugging to learn the commands needed for communication on the gmlan CAN bus.. I guess I'm not so good at explaining what I was looking for,lol...

So far so good with Processing.. The keyboard routine is turning into a little but of a pain, but I'm still working on it as time allows.. Thanks again everyone!!!! Tom

Processing actually looks kind of interesting ....