Конвертор кода: Go -> C++ и Python (форк https://github.com/andygeiss/esp32-transpiler)
Найти файл
2018-03-14 15:24:03 +01:00
application/transpile first commit 2018-03-14 15:24:03 +01:00
business first commit 2018-03-14 15:24:03 +01:00
infrastructure/ino first commit 2018-03-14 15:24:03 +01:00
platform/main first commit 2018-03-14 15:24:03 +01:00
.gitignore first commit 2018-03-14 15:24:03 +01:00
LICENSE first commit 2018-03-14 15:24:03 +01:00
Makefile first commit 2018-03-14 15:24:03 +01:00
README.md first commit 2018-03-14 15:24:03 +01:00

ESP32 Transpiler

Purpose

The Arduino IDE is easy to use. But I faced problems like maintainability and testability at more complicated IoT projects. I needed to compile and flash the ESP32 before testing my code functionality by doing it 100% manually.

This solution transpiles Golang into Arduino code, which can be compiled to an image by using the ESP32 toolchain. Now I am able to use a fully automated testing approach instead of doing it 100% manually.

Important: The Transpiler only supports a small subset of the Golang Language Specification. Look at the tests in infrastructure/ino/worker_test.go for more information.

Installation

First install necessary packages by using:

make packages

Test and Build

Now Build the transpiler executable by running:

make

Install

Copy the transpiler executable into your $GOPATH/bin directory. Then copy the file which will be used as mapping Golang to Arduino-API:

make install

Usage

Usage of esp32-transpiler:
  -mapping string
        API Mapping file (default "/home/user/esp32/mapping.json")
  -source string
        Golang source file
  -target string
        Arduino sketch file