It is posible to use a code in python to program a microcontroler like pic16f877a?
The issue is the micro controllers generally work on a version of assembly. They are a number of programming utilities that translate other languages to this, but I have not seen one for Python. I have seen basic as an option, so they do some different languages, but the script nature and JIT code of Python makes it ill suited for this.
Hmm... though it looks like others have pushed this along more than I thought it would go! Python to ASM: http://projectproto.blogspot.com/2009/12/python-for-pic-mcus.html Python on a chip: http://wiki.python.org/moin/PyMite And a python based micro controller: http://www.pymcu.com/blog/ I certainly did not expect that out there! Thought I would look because I remembered there were some Python compilers, as in make stand alone, so I wondered if they might have a way to make that work. That is the first one. But the other two are things I had not thought they would do.
Have you had a look at an Arduino microcontroller? Cheers Gusto
Arduino doesn't run python code. However, have a look at the Raspberry pi, which isn't a microcontroller per se, but boards like the Arduino can be attached to it.
@russelladams There are ways to program the Arduino via Python. So while the code is not running on the Arduino, it is controlling it. http://playground.arduino.cc/interfacing/python http://forum.arduino.cc/index.php/topic,8332.0.html And people are looking into making a Python subset for it... though I am not sure if there is really a great need for that.
@e.mccormick From what I've read in the past, you can't actually program the Arduino with Python. The sketches have to be written in c. But, there is a Python wrapper that you can use with Arduino Sketches.
They now have C and Assembler wrappers where it takes a special set of Python and turns it into the proper machine code for the micro controller. So it ends up being a way to use Python but not really run Python.
And if you search for Python here, you will see two other interesting ones: http://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems
Join our real-time social learning platform and learn together with your friends!