How do I make code interact with hardware?
Asked by
intro24 (
1434)
June 13th, 2010
I have an idea for a project that requires some programming but I’m not quite sure where to go from there. I’ve written some lines of code in Python 2.6 that currently works by me inputing numbers and then getting a text output. My question is how do I make something such as a speedometer input the values rather than myself? Also, instead of text I would like the output to control LED’s.
This whole setup needs to be somewhat portable (not on my computer). So does anyone have an idea how I should go about doing this? Thanks in advanced and just ask if something’s unclear.
Observing members:
0
Composing members:
0
4 Answers
You may have to write drivers for your input devices. And choose/develop the connections you would use to input/export data. If you want a custom output device [an LED instead of a computer-simulated LED] you may need drivers for that too. Will these devices also need power? Ambitious project. Sounds interesting
This would be a great question to ask someone who develops tecchie exhibits for Smithsonian, like one I wanted to do years ago that would have interfaced various submarine parts with multi-user computer control system for an interactive conning tower exhibit [it was too expensive]—same principle as pilot training devices—or on a simpler scale, pedometers that can have contents uploaded to websites so you can track your steps.
To clarify I was thinking of somehow using a Lego Mindstorm set or something similar like those what are used for controlling robots and whatnot but I really don’t know enough to say for sure. And the “hardware” isn’t exactly complicated; just something to input speed and turn on some LED’s.
You won’t be able to use Python on microcontroller for a while but I’d recommend the Arduino platform. It’s the largest community-wise and pretty darn easy to build awesome projects.
If you must use Python you’ll probably have to buy a PC/104 computer (because Python requires a full-blown operating system. PC/104 systems are a pain in the ass if you don’t know what you’re doing and expensive.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.