What language are the computers inside of cars written in? i would guess C++
Printable View
What language are the computers inside of cars written in? i would guess C++
It probably depends on the manufacturer. I would have to guess C/C++.
Most programs in embedded devices are coded using ANSI C or Assembly Language geared toward the processor the device uses.
This was my immediate thought.Quote:
Originally Posted by bgmacaw
C is what I would expect. There seems to be a C compiler for most every microcontroller. It may not be ANSI C, but it is a distinct C flavor.
maybe although there are some microcontrollers that have built-in basic interpreters.
Basic is too imprecise and bloated to be used in automotive applications, where speed and efficiency are essential.
i wouldn't know about that. Especially since it is automatically compiled into machine code on controller chips no matter what language you start with. A Basic Stamp micro-controller ONLY supports basic instructions which it then compiles into machine code. Who knows for sure what language their compilers run on? And being an auto-mechanic, i can tell you that except for ultra-modern luxury cars, their computers aren't that precise anyway. All they really do is monitor multiple sensor inputs and adjust one output based on a built-in look-up table. Now, they have other functions on obd-ii systems, which allow you to view the same readings the computer does, such as voltage from the map sensor on a graph, but the basic functionality has not changed in about ten years. Think of a cruise-control computer for example. All it does is store a speed setting read from a d/a converter and try to match that speed by adding or subtracting voltage to a servo that is attached either directly to the throttle or to a vacuum valve which is then attached to the throttle. And believe me, THOSE computers are imprecise. It is not uncommon to vary 2 or 3 mph while on cruise constantly, especially on older vehicles due to the frequency of reading the current speed.
thanks all for your replied, continue chatting :)
Many embedded programmers don't like C++ because it is 'bloated' as compared to plain old C or assembly.Quote:
Originally Posted by wossname
Embedded programming harkens back to the old days of PC programming when the goal was to cram as much code into as small a space as you could and use as few processor cycles as you could.
I wouldn't say its C++. I would thing its a modified version of assembily. At least for the car itself. The likes of the Satnav etc i would say a modifed version of C maybe defifintly not c++ its to big!