AboutAlex Barry Expertise I have been a qbasic programmer since 2000, creating games, minor libraries and various small programs. I have experience using interrupts, graphics, file input/output, the mouse cursor, and using libraries. I have also learned FreeBASIC, c/c++, python, php and html.
I do not claim to be an absolute authority in any language, but I don't mind looking things up and learning with you.
Experience Hobby programming since 2000
I no longer belong to any community programming groups, but do have knowledge of *basic dialects and C/C++
Question Hi Alex,
I am developing some simple robotics projects - eg remote lawnmower. I was hoping to do some simple coding in say qbasic which I have used many years ago - this would allow me quick experimental coding of motion control.
I have heard that later versions of windows excludes direct access to hardware ports?
I am using xp.
what can you tell me about these things.
If I have qbasic running in a window, then I suppose there might be timing issues with the processor only giving intermittent service to my programs?
All this windows multi thread event driven stuff is just overhead that I hadnt anticipated.
Answer Hi, David,
I do believe you are right about windows limiting access to hardware from a dos-prompt. There are a few things I can suggest you trying first, though, before doing any major changes.
The first would be to try using OPEN "COM:..." to access the serial port. You will have to check your own computer setup to see which com port is your serial port (generally it's COM1, but setups vary), and which baud rates you need, and what sort of information you need to pass and receive.
You could also try to run QBasic through DOSBox and using hardware interrupts - this is a trickier method, and it would be good to have a basic knowledge of assembly language. You may want to google for "Ralph Brown's Interrupt list"
If you are willing to do some minor switching, you could probably learn VisualBasic fairly easily, and then use the hardware interfaces from there. I believe you can download a free copy from the Microsoft website (check for Visual Basic Essentials on their website).
Now, if you wanted to do a big switch, the next suggestion would be to either program in C or Assembly, which may be very big jumps from QBasic for some simple hobby projects, so I wouldn't recommend this unless none of the other methods work.
If you have any other questions, hopefully I've answered them so far, and you can always ask again if you get stuck.