Jump to content

Anybody know of a SIMPLE programming language?


Stealthbomber

Recommended Posts

Another random question for Arnies eclectic membership...

 

Anybody know of a simple programming language that'll allow me to control the serial port on my PC?

Ideally it'll be something that is like BASIC but run in the Windows environment.

Oh, and freeware would be nice too. :)

 

I wrote a DOS BASIC program to do this ages ago but, IIRC, the last time I looked at redoing it for Windows I couldn't find anything that could control the serial port in the Windows environment.

As a result, I just kept on using the DOS program but I'd like to give it another look.

 

I did get involved in Visual BASIC a while back but I found it horribly long-winded for creating simple programs which would only be 20 lines of normal BASIC code.

 

FWIW, I do have a couple of Arduino boards which I could program to do what I want independantly but I'd like to do this from a PC so I can modify the program later on to do more clever things using key-presses etc.

To do that with an Arduino board would mean adding hardware switches etc and building it all into a project box.

 

Anybody have any suggestions?

Link to post
Share on other sites

I did some of this in Systems and Control at GCSE. My teacher told us that modern versions of Windows cannot address the serial via the keyboard (we were doing it on an ancient Compaq laptop whose battery was so knackered it had to be permanently plugged in).

 

However, he also said that there were programs that would let you do it, but we weren't going to bother because the school PCs don't have serial ports.

Link to post
Share on other sites
Depends on the hardware plugged in and what it does.

 

But you could probably get a generic program or command then map it to do what you want.

 

I suspect the talk of building his own hardware as an alternative solution means it might be a bit more on the complex end.

 

serialterm lets you 'talk' to a serial port:

http://www.comp.lancs.ac.uk/~albrecht/sw/terminal/index.html

 

No idea if it runs in the latest versions of Windows though as I've not used it in years!

Link to post
Share on other sites

Basically, the plan is to poll the voltages at various pins to operate relays and operate stuff in the real world.

Mostly it'll be for the purposes of switching stuff on and off on timers.

As I say, it'd be really simple to set up an Arduino microcontroller to do this but I'm thinking I might want to develop things so I could, at best, set something up so a command over the interweb could switch something on.

That's the sort of thing where a software solution will be more flexible than using a hardware microcontroller.

 

Thanks for the info so far.

That Python doodah seems pretty straightforward.

I was pretty good at Assembly language back in college but, beyond that, my programming experience is limited to teenage years delving into Sinclair BASIC.

Object oriented programming is like greek to me.

Need a good guide filled with simple examples and lots of explanations. :D

Link to post
Share on other sites

I wouldn't use ASM. These days compilers are smart enough that you don't need to hack something together in ASM to make a function a little bit more efficient (code tuning).

 

I would say C is probably your best bet as it's a low level language and is probably bang on what you're looking for except for the fact that it's not that simple.

 

PS: You can actually program in C++ procedurally. It's just with objects it's a lot easier to manage and more "modular" I guess.

 

In short I would suggest C but then again it's going to be a lot of extra work to learn it. If you need help I can help you with like super basic stuff in C since I'm a C++ programmer in my second year of university. C++ on the other hand I can lend you a lot of help up to object design, data structures, algos, and some basic design patterns.

 

EDIT: I thought of something else as well. I'm not sure how easy it is to implement or if it's even possible but how about using an AVR (like Vice said below me the ATMEL ATMEGA Microcontroller) and controlling your system via that. I know that people have made some pretty cool things with that so maybe it's worth looking into?

Link to post
Share on other sites

If you're going to use the arduino use Processing or Java, unless you need the code to be uber fast?

 

For my 3rd year group project we made a huge LED cube, controlled by computer via the arduino. Ended up scrapping processing and writing all the java ourselves, worked out pretty nicely in the end. Had full GUI control and instant refresh of the cube, looked great, scored us a very decent 1st (80%).

 

I'm pretty sure you can write assembly and whack it on the Atmega32's the arduinos come with.

Link to post
Share on other sites
That Python doodah seems pretty straightforward.

I was pretty good at Assembly language back in college but, beyond that, my programming experience is limited to teenage years delving into Sinclair BASIC.

Object oriented programming is like greek to me.

Need a good guide filled with simple examples and lots of explanations. :D

 

Yer the reason I suggested Python is that:

 

- It's free.

- It supports serial comms.

- Doesn't take a lot to get up and running.

- Is simple to understand without loads of weird syntax to learn.

- Hugely flexible, script or compiled, all major OS's, has a bogglingly huge library of stuff to bolt on.

- You can program as you would in a procedural, object oriented or even functional language.

- Has a huge online userbase to provide help and advice.

Link to post
Share on other sites

Gota echo chimpy here. Python python python python.

 

The language is awesome; I'm currently doing my third-year comp sci project in it. One of the reasons I chose it is because it's powerfull, extensible, cross-platform, and, most importantly, it WORKS easily.

 

I find with Java and C that doing anything complex end with you fighting against the language to get half of it done. With python, it's just... simple.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the use of session cookies.