I've been using Python for quite long, and I was wondering if it can be used as a programming language for Arduino, rather than C/C++.
When I'm using the Arduino IDE, the sketch is compiled into a hex file that contains the program binary.
Knowing that micro controllers execute only binary, I would like to know if there is a tool to convert Python code into binary, so that I can upload it directly to Arduino using AVR or other programmers.
I read about Micro Python, a lightweight adaptation of Python that can fit in boards, but can only work with PyBoard, 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 in IOT.
-
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:00Commented May 31, 2019 at 11:40
-
And I say that as someone who uses Python extensively in personal projects. I like Python - but not on my ArduinoJRE– JRE2019年05月31日 11:41:19 +00:00Commented May 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:00Commented May 31, 2019 at 14:18
-
@Gerben Do you know some examples ?Amine Messaoudi– Amine Messaoudi2019年06月03日 09:33:42 +00:00Commented Jun 3, 2019 at 9:33
-
2Their website has whole range of board that run their version of microPython. See adafruit.com/circuitpythonGerben– Gerben2019年06月03日 14:03:17 +00:00Commented Jun 3, 2019 at 14:03
1 Answer 1
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:00Commented May 31, 2019 at 13:13
-
2The GitHub repo, 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:00Commented May 31, 2019 at 13:16