c++arduinoesp32micropythone-ink

Is it possible to pass data between MicroPython and C++ in ESP32?


We are working on a prototype using the ESP32-DevKitC-VE and e-paper. The e-paper manufacturer provided C++ sample programs for Arduino and we were able to get the ESP32-DevKitC-VE and e-paper to work as expected.

We want to generate the data to be displayed on the e-paper in MicroPython. Is it possible to somehow pass it to the C++ programs for Arduino to display on the e-paper? If so, how can I do that?

Can the MicroPython and Arduino C++ programs coexist, or can only one exist?


Solution

  • Just to be clear: C++ programs don't "exist" on the ESP32. Only the compiled code is running on the microcontroller. MicroPython, however, is an interpreted language and does "exist" in source on the controller.

    To answer your question: Yes, it is possible to call specialized libraries (C++ source code) from MicroPython, but you have to compile your own library "into" MicoPython. There is a good description on how to do this (with example) in MicroPython documentation pages: MicroPython external C modules

    I would suggest that you create your ePaper library in C++, integrate it with MicroPython source code and build a specialized version of MicroPython to be flashed to the ESP32