Using micropython with arduino core
-
- Posts: 2
- Joined: Fri Aug 04, 2017 10:44 am
Using micropython with arduino core
Is it possible to write a program in arduino core and have micropython at the same time? I want to have a scripting language, but can't write it entirely in python due to a bad performance. I know that I can embed C code in micropython, but can I use arduino libraries there?
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Using micropython with arduino core
There's a relatively new project to embed micropython into mbed-os. I find the mbed API and overall environmnet much more appealing than the Arduino one.
https://developer.mbed.org/users/infinn ... icropython
https://developer.mbed.org/users/infinn ... icropython
Re: Using micropython with arduino core
Have you looked at the @micropython.native and @micropython.viper decorators?
-
- Posts: 2
- Joined: Fri Aug 04, 2017 10:44 am
Re: Using micropython with arduino core
@micropython.native does not work on ESP32
The library I want to use is https://github.com/Bodmer/TFT_eSPI It works on Arduino. I don't want any other library since only this one gives the performance I want. Porting it is out of my skills ;/
Can't I put this library and arduino core for ESP32 together in stmhal?
The library I want to use is https://github.com/Bodmer/TFT_eSPI It works on Arduino. I don't want any other library since only this one gives the performance I want. Porting it is out of my skills ;/
Can't I put this library and arduino core for ESP32 together in stmhal?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Using micropython with arduino core
Firstly stmhal is the branch for STM processors such as the Pyboard. It is irrelevant to the ESP32 which has a different processor architecture (Espressif).
There are two approaches which could be used, but both require some expertise. The approach I would use is to port the code to Python. If you can read C and write Python porting is straightforward donkey work.
The C code could in principle be ported so that it appeared as a native MicroPython module. In my opinion that would be more difficult, but that could reflect my own language preference. I think others will probably agree that with a library of that size it would require good C skills and an understanding of writing C modules for MicroPython. There is a fair amount of information on the latter topic in here.
The easy solution is to use a display where the donkey work has been done, for example the official LCD160CR module. Or search in here and in the Wiki for display drivers. There are quite a few...
There are two approaches which could be used, but both require some expertise. The approach I would use is to port the code to Python. If you can read C and write Python porting is straightforward donkey work.
The C code could in principle be ported so that it appeared as a native MicroPython module. In my opinion that would be more difficult, but that could reflect my own language preference. I think others will probably agree that with a library of that size it would require good C skills and an understanding of writing C modules for MicroPython. There is a fair amount of information on the latter topic in here.
The easy solution is to use a display where the donkey work has been done, for example the official LCD160CR module. Or search in here and in the Wiki for display drivers. There are quite a few...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.