Troudeloup
asked on
c++ VS. python: hardware control.
my electronics class almost touched using computer to control hardware, but we ran out of time. it was to be powered by and controlled through a COM port (like the old mouse port, remember?) and DC motors and lights could be operated through that.
my question is though, the python.org headline picture shows a lot of electronics and stuff, I am wondering though, is c++ better at controlling "simple" stuff like DC motors , or maybe today python can do some of those as well?
I'd love to initiate hardware controls from python than c++ ( and i don't care if I am not as powerful, it's just easier to learn)
I guess my question is actually, how to start hardware stuff with python, or rather, how to start hardware design.
my question is though, the python.org headline picture shows a lot of electronics and stuff, I am wondering though, is c++ better at controlling "simple" stuff like DC motors , or maybe today python can do some of those as well?
I'd love to initiate hardware controls from python than c++ ( and i don't care if I am not as powerful, it's just easier to learn)
I guess my question is actually, how to start hardware stuff with python, or rather, how to start hardware design.
You can do whatever you want from python.
True you don't control memory addresses in python, but (a) usually it's not needed as you have hardware control through devices like COM-port which are easily accessible via file interface and
(b) python 2.5 has direct native dll access (ctypes module) which allow you access anything (ctypes is also available for earlier version of python).
In your case it should be extremely easy: type some char to COM to start/stop the motor.
True you don't control memory addresses in python, but (a) usually it's not needed as you have hardware control through devices like COM-port which are easily accessible via file interface and
(b) python 2.5 has direct native dll access (ctypes module) which allow you access anything (ctypes is also available for earlier version of python).
In your case it should be extremely easy: type some char to COM to start/stop the motor.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
c and c++ can thats why a lot of apps are written in c