Beyond Processing, ie. C#, C++, Python etc...

Hey guys,

I'm very new to Processing and Arduino. I do however have some general programming experience, quickbasic, visual basic (6) and .NET, filemaker and a bit of html and css. and have written some workable and useful solutions. (that was a while ago :disappointed_relieved: )

The main function of this new program will be for data acquisition, ie. data logger.

What I would like to do is record and save the data to computer disk (which I have been able to do with Processing) but improve on the GUI, ie. basic buttons, drop down menus, check boxes, open/save dialog box, basic 2d graph plotting - pretty basic requirements I would think.

One main requirement is being able to create a "stand alone solution". Mainly for pc, but mac os and linux would be handy.

I've done a fair bit of research in the last couple of weeks but still are unable to choose which direction to take. I downloaded the free version of Visual Studio C# 2010 and had a look at a simple serial program that I got off the net - It had to be converted from an older version so I don't know if there was a lot of redundant code, but there was so much code for such a simple task that it confused the hell out me.

I had a look at some Python examples and I quite liked the look of it. I have always wanted to learn C but in some ways I would rather work on the usability and functionality (from the end user point of view).

Your experiences and suggestions much appreciated.

Cheers.

You may be interested in this simple Python GUI demo and this non-GUI Python comms demo.

The Python TKInter GUI stuff works across platforms, but I can't recall if it needs to be specially installed on the PC or whether you can bundle it with your app and have it work anywhere.

This EzScrn demo uses Python to operate a web server so the output can be viewed in a browser. Using a browser for the interface makes cross-platform stuff easier and, generally, the browser interface is easier to program than TKInter IMHO.

...R

Thanks Robin. I did have a look at the examples you suggested - they were the ones I came across last week when I did a search. I'll have to look into it in more detail.

The cross platform issue is not really that important.

The data acquisition software I'm wanting to create will be reading analog data (arduino uno) connected to a load cell and voltage amplifier. The purpose is to test the performance of small rocket motors. As such, the tests have to be done "off-site".

Therefore an old laptop running windows xp would be suitable and pretty cheap. I'm still running winxp on my desktop and will need to stick with this at the moment for testing purposes. The software and Arduino implementation will be shared with others on pyrotechnic and model rocket forums that I'm affiliated with.

I have done this all before - some 10yrs back using an AD convertor kit connected through the parallel port using software I wrote in quickbasic (dedicated laptop running dos). It all worked perfectly well, recorded data, made a graph that could be zoomed & edited and did all the math. I don't know how I managed to do it.

Apart from the obvious limitations with quickbasic and dos, the device was only able to record 8bit - whereas the Arduino is 10bit.

Somehow the whole task of upgrading to better software and hardware seems a lot more complicated just to get something simple happening compared to quickbasic.

I'll keep doing some research - might see if there's an old free version of visual basic.

Cheers.

If you want to use an old and cheap PC or laptop you may be interested in Puppy Linux - which is what I am using.

You might also want to consider an Arduino Yun which can run Python code (and other languages) on the Linux side and store data on an SD Card. It has WiFi and can also run a webserver so it would be easy to view data on any device with a browser.

Another option is a RaspberryPi with an Uno.

...R

Yeah cheers R, much appreciated. I've read a bit about RaspberryPi. I don't wish to go too far though, I also need to stay with the UNO.

To me, programming is only a means to an end. It may well be, that I have the dubious honour of being the filthiest, laziest, dirtiest and most unremarkable programmer in the history of humanity!... but I don't care.

As long as "tool" is made and used effectively, it lasts and is accurate enough to serve the intended purpose - what does it matter how we got there? :stuck_out_tongue:

Anyway, I digress. I downloaded a free version of VB 2008 Express because I have some familiarity with it. Accessing the serial port will be the challenge.

Cheers.

stixstudios:
I also need to stay with the UNO.

I said "RaspberryPi with an Uno"

The RPI would take the place of your PC. As would the Linux side of a Yun.

...R

Sorry, what I meant to say was:

I don't wish to go too far though, I would prefer to stick with winxp on a laptop using the UNO.

Please don't take it that I'm ignoring your good advice, but at this point I'd rather stick with what I already have - it's going to be a challenge enough without introducing something new.

Cheers.

[EDIT] I did just have a look at Puppy Linux. This looks very interesting, but I'm getting side-tracked again :slight_smile:

stixstudios:
but at this point I'd rather stick with what I already have - it's going to be a challenge enough without introducing something new.

Very sensible.

...R

Thanks R.

I spent the whole day today umming & ahhing and reading about the pros & cons of C# vs VB and tried to digest what Puppy Linux was all about. Puppy Linux does seem very promising and worth further exploration. In the end I couldn't take it anymore, and came to the realisation that VB will be the way forward.

The reason being, as I already pointed out, and you also reaffirmed:

...but at this point I'd rather stick with what I already have - it's going to be a challenge enough without introducing something new.

Some say "Familiarity breeds contempt", I say "Familiarity gets the job done"... stix 2015.

I did really want to learn C, I always have - possibly as a career change but left it too late. I've come to the awful conclusion that a programming career in any language will not be a great investment of time with any great financial reward unless you come from an under-developed country with low costs of living.

The same goes for graphic design, web design, web development, programming or any other career based on computers and shared knowledge - the level playing field indeed! Although obviously I'm benefiting, but this is only for personal achievement.

Just in case I'm wrong, I'd like to take this opportunity, without coercion, and being of sound mind, to state forthwith to all future potential employers, that this statement:

...I have the dubious honour of being the filthiest, laziest, dirtiest and most unremarkable programmer in the history of humanity!... but I don't care.

Was completely incorrect - it's just my warped sense of humour, I'm really really really good. :stuck_out_tongue:

Reading the data from the serial port using vb is the hard part that I don't understand. I'll post questions in the relevant forum.

Cheers, stix.

stixstudios:
Reading the data from the serial port using vb is the hard part that I don't understand. I'll post questions in the relevant forum.

I'm afraid I have forgotten all I used to know about VB.

...R

I've just started playing with VB and found it easier and quicker than expected. I did hit a few walls but google had answers to all my questions. Managed to get my first app working in a weekend (an Arduino to VB data logger) and a more complex control app working in a week or so.

You probably already know, but Visual Studio 2013 Community is available free for hobbyists and students. This includes VB and also C++ plus others.

For a basic example have a look at receiving-data-from-the-arduino

Hey thanks for that Martin.

I think I've seen that link you posted in my travels. Anyway, I've managed to get something up a running in VB. Seems to work except for the occasional "hang" so I will need to look more into that.

You are correct, I did know about Visual Studio 2013 Community. Unfortunately it doesn't run under Winxp.

Cheers.

[EDIT] I've got C# 2010 and may even take the time to learn that as much as I can. So contrary what I've previously said, I'm going to switch to C#. I was getting getting familiar the braces and semicolon line endings whilst using the Arduino and Processing Software. Also there's Java as well that uses similar grammar (if that's what you call it), So it may be more useful to learn C.

I've got C# 2010 and may even take the time to learn that as much as I can.

Good idea. Far more useful than VB from an employability point of view.

So it may be more useful to learn C.

Which is completely different from C#...

Thanks Paul.

I didn't realise that C# was a lot different than C.

I've done a fair amount of reading on this forum and understand that your good self is a positive supporter of C#. Is this due to your involvement with Arduino projects? or can C, C+, C++ or other variants that I don't know about, be used effectively as well.

I downloaded some serial source code (VB) and fiddled about a bit and got it to read the analog data from the Ardy and save to file, but it was flakey and hung sometimes. I also got some C# code working to a lesser extent.

I'm at the point of Donald Rumsfeld's "Known Unknowns"... in that, I know there are things that I don't know about, in regards to serial comms with C (or VB.NET). Bizarrely, I have a 20yr old book somewhere "The C Programmers Guide to the Serial Interface" or similar - perhaps I could have a look for it.

Nevertheless, I don't wish to become an expert in serial comms, I just need to understand generally what's going on and therefore be able to modify to suit my requirements.

OOP is a fundamental shift in my thinking - my programming experiences are more of a "procedural" nature.

If you could point me to some good resources (books, ebooks, written tutorials - not video) that would be appreciated.

Cheers.

Is this due to your involvement with Arduino projects?

It has more to do with my job. But, C# does make talking to a serial port easy, and that is how you communicate with an Arduino, so it's a natural choice.

or can C, C+, C++ or other variants that I don't know about, be used effectively as well.

C and C++ can be used, though the C code is not at all straightforward, and the C++ classes are not that easy to use, either.

Bizarrely, I have a 20yr old book somewhere "The C Programmers Guide to the Serial Interface" or similar - perhaps I could have a look for it.

Nothing has changed fundamentally, so the book will still be good, IF you want to get into the nitty-gritty. If you just want to read from, and write to, the serial port, for the purpose of building an application/user interface, the how-to is isn't significant.

PaulS:
...Nothing has changed fundamentally, so the book will still be good, IF you want to get into the nitty-gritty. If you just want to read from, and write to, the serial port, for the purpose of building an application/user interface, the how-to is isn't significant.

Thanks Paul. I think I'll stick with C# at this point - and no, I don't really want to get into too much of the nitty-gritty. :sleeping:

I don't wish to be spoon-fed, but can you direct me to some basic C# code for accessing the serial port. That way I can fiddle with it, then ask questions when I get a bit stuck. I think I would learn more that way. Although that could very well drive others a bit crazy :slight_smile:

Cheers.

Greetings,
just created a simple software for you i think this might help
this software do the following
Set a specific key so that when you press this key something is sent to the arduino through the COM. port
so you can tell the software for example to do the following
"When i press the 'W' button send to the arduino the following character 'a' "
you can achieve this by editing the INI file

i`ve created this software with C#


in the INI file :;

The software link :
Download
NOTE: SOURCE CODE IS NOT INCLUDED

ProNoob:
NOTE: SOURCE CODE IS NOT INCLUDED

Why not ?

...R

Robin2:
Why not ?

...R

i think i need to rewrite my code in a more clear non ambiguous way then i`ll post it here if anyone is interested

ProNoob:
i think i need to rewrite my code in a more clear non ambiguous way then i`ll post it here if anyone is interested

That's good. I don't use Windows but I'm sure many others will be interested.

I had been concerned that it was "secret" code.

...R