NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Everything Else » Best programming software for handling microcontroller interrupts and graphics?

April 17, 2012
by mcgroover
mcgroover's Avatar

Hi fellow nerdkitters,

I saw the tutorial on "Digital Scale Strain Gauge Weight Sensor" (nice video, probably the best one IMO) and I noticed the use of python for accepting the interrupt from the microcontroller to change the graph on the computer.

I have also heard that Java can be used for this sort of application. I was wondering what everyone's opinion was of the best programming software to handle interrupts and move graphics around the screen based on the interrupts? (for example, moving a thermometer graphic from input from a temperature sensor on the breadboard and microcontroller).

I am mostly familiar with visual basic, but not sure if this is appropriate when dealing with microcontrollers or whether there are even any free versions of that?

Thanks in advance for your input!

April 17, 2012
by JimFrederickson
JimFrederickson's Avatar

I have used Python.

It is VERY versatile, and that is quite a nice feature.

For me though, I don't really need 'yet a new programming language' to deal with.

I have chosen to stick with Java.

That is working out quite well for me, and Java itself is at least fairly portable.

There is a HUGE PROBLEM though, in that Java/Oracle doesn't directly support serial devices...

Something that seems pretty stupid to me. (They did try to a few years ago to incorporate their own Serial Device Support, but it seems that they have given up.)

I use the RXTX extension to Java to provide access to the Serial Ports on my computers.

It works both in 32bit and 64bit Ubuntu and Windows 7 environments. (Which fits all of my needs...)

It is a 'pain in the a@@' to get to run, but most things are for me in regards to Java and Linux.

Once installed and configured properly though, it does run great.

I had problems with my serial data getting corrupted, but that didn't have anything to do with RXTX or Java.

I have been using NetBeans for the programming environment, and it works both in Windows and Ubuntu and seems pretty much the same.

April 17, 2012
by pcbolt
pcbolt's Avatar

If you are familiar with Visual Basic, you might try using that language inside MS Excel. Here is a link to a NK forum thread that has a ton of info. I've seen some You Tube videos on the subject as well...pretty versatile.

April 18, 2012
by mcgroover
mcgroover's Avatar

Thanks for the input.

Jim, you may have put me off Java now! :)

Pcbolt, I was hoping to create an executable file (which I believe you can do in python, right?). I read through that thread and it doesn't look like that is possible with that, but I would love to be proved wrong.

It seems like the consensus that Python is the go-to software for this sort of thing, right? I have never programmed in Python before. Has anyone had any experience with it? If you are reasonably familiar with VB and C, can it be that different?

April 18, 2012
by pcbolt
pcbolt's Avatar

mcgroover -

Python is an interpreted language, so it needs the "interpreter" program on the host machine. For a stand-alone executable, you can stick with "C" and use the gcc compiler in Linux and cygwin (freeware) in Windows. I prefer Visual C/C++ just because the library help is extensive when interacting with the Windows API...'course you have to pay for that.

April 18, 2012
by JimFrederickson
JimFrederickson's Avatar

Hello mcgroover,

So what specifically in my post 'put you off of Java'?

That was not my intention, as I said I use it, but I am very curious what the main issue for you was?

VB, as well as VBA and VB Script, is pretty good. My specific issue with those were that I really wanted to be portable across Windows 7 and Ubuntu Linux. (Maybe other Linux's in the future, but for now I am using Ubuntu and don't see any reason to switch.)

Python has been around for some time, and it is VERY VERSATILE. (Portable between Windows 7 and Ubuntu as well if you are careful with your choice of libraries to incorporate.)

Thanks, Jim...

P.S. If it is the 'HUGE PROBLEM' part, that was more 'personal commentary and philosophy'.

It does make alot of sense to me that a Language Designed to be Portable across hardware/OS's, did not support probably the most portable, as well as versatile, communications interface directly!

April 18, 2012
by JimFrederickson
JimFrederickson's Avatar


Last paragraph of my previous post "does" should be "doesn't"...

April 19, 2012
by Ralphxyz
Ralphxyz's Avatar

Also Python and JAVA run on OS X.


April 19, 2012
by sask55
sask55's Avatar

I have considerable coding experience with VBA in Excel and Access applications. I am just starting to get a handle on Microsoft Visual Studio Express so I am no authority on its portability. As I understand it now, as far as making exe files using Visual Basic Express (which is free) it is possible as long as you stay with a windows operating system on the machines that you intend to run your program.

I believe that you could write your code in Visual Basic Express if you are comfortable using Visual Basic. You can then compile your program to run on a windows operating system. This solution may not be adequate for your purposes as the resulting executable would not be portable to non windows machines.

I am intending to experiment with using Visual Basic Express or possibly Visual C# for a couple of projects I have on the go. Unfortunately it will not be until this fall that I will likely get any experience implementing any programs using Visual studio. Primarily I am looking for the speed and lower overhead that a compiled language should give.

As usual there is a lot of discussion on line about the strengths and weakness of Visual studio.

Take a look at this video


January 07, 2013
by scootergarrett
scootergarrett's Avatar

I learned C and am a stubborn engineer so I stick with it. I have used C coupled with gnuplot and Serial interface with basic C program to get live plotting to work for me but it took a lot of work but I’m even better with C now.

Post a Reply

Please log in to post a reply.

Did you know that you can use printf and scanf functions to talk to your computer from your USB NerdKit? Learn more...