简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM