I've been usingPython for quite long, and I was wondering if it can be used as a programming language forArduino, rather thanC/C++.
When I'm using the Arduino IDE, the sketch is compiled into ahex file that contains the programbinary.
Knowing that micro controllers execute only binary, I would like to know if there is a tool toconvert Python code into binary, so that I canupload it directly to Arduino using AVR or other programmers.
I read aboutMicro Python, a lightweight adaptation of Python that can fit in boards, but can only work withPyBoard, which I have never used yet.
I believe that Arduino manufacturers should start developing boards that can run Python, because it's very simple to use, unlike C/C++. It also has a lot of builtin modules that can make development very easy, which will achieve a remarkable progress inIOT.
- Python is an interpreted language with a lot of libraries. You would need either an interpreter squeezed into the Arduino, or a compiler that makes assembly code from Python (maybe by way of C.) Too much hassle for too little gain.JRE– JRE2019-05-31 11:40:22 +00:00CommentedMay 31, 2019 at 11:40
- And I say that as someone who uses Python extensively in personal projects. Ilike Python - but not on my ArduinoJRE– JRE2019-05-31 11:41:19 +00:00CommentedMay 31, 2019 at 11:41
- 2Adafruit has a few boards that run microPython. As far as I know, those will interpret code, so don't require precompiled binaries.Gerben– Gerben2019-05-31 14:18:22 +00:00CommentedMay 31, 2019 at 14:18
- @Gerben Do you know some examples ?Amine Messaoudi– Amine Messaoudi2019-06-03 09:33:42 +00:00CommentedJun 3, 2019 at 9:33
- 2Their website has whole range of board that run their version of microPython. Seeadafruit.com/circuitpythonGerben– Gerben2019-06-03 14:03:17 +00:00CommentedJun 3, 2019 at 14:03
1 Answer1
To my knowledge, there is not a "python to ATMega architecture" compiler out there.
However, it's not true that MicroPython only runs on PyBoard. There are versions for installation also on the ESP8266 and ESP32 chips, and so the popular NodeMCU and Wemos D1 development boards, or any of the other similar products with those processors, can easily run Python code. Many of these are available at a very low cost from the usual retailers/sources.
Be aware that MicroPython is somewhat limited compared to the full version due to the limited RAM available on these boards.
- Can the arduino mega run Python ?Amine Messaoudi– Amine Messaoudi2019-05-31 13:13:44 +00:00CommentedMay 31, 2019 at 13:13
- 2The GitHubrepo, ports directory, indicates no support for ATMega processors, which is what is in an Arduino Mega.jose can u c– jose can u c2019-05-31 13:16:53 +00:00CommentedMay 31, 2019 at 13:16
Explore related questions
See similar questions with these tags.


