Micropython Machine Library


#1

Hi,

I am trying to utilize the whole Micropython Machine Library, but have no idea if Zerynth Studio can take it.

Please shoot me some suggestion.

Thanks


#2

Hi saintola,

Here you can find a general overview that shows the main differences between Zerynth and Micropython philosophies.

Said that, for those devices and hardware features supported by Zerynth, it is possible to port Micropython code in Zerynth scripts with little effort.
You can "translate" the several macros of your firmware from Micropython sintax to the Zerynth one, or, better, you can implement and publish a dedicated library so everybody else with this necessity can use it.

You can take a look at our documentation where all available peripheralslibraries, etc. are described along with many examples.

Just keep me posted if you need further help on this.


#3

hi @saintola ,
you don’t need to use the Micropython Machine Library (MML) to run micropython scripts in Zerynth. Zerynth has its own MML equivalent calle Zerynth Hardware Abstraction Layer.
This means that in Micropython and in Zerynth some hardware peripherals are accessible by using slightly different functions.

So, you just need to import the micropython script you want to execute on your board and work on minimal syntax and functions’ names adaptation.
let us know if you need any specific help!


#4

Hello, a full HC n00b here:

I am trying to get the LCD 1602 to run on ESP32, but all the samples I find require the Machine library. If I understand correctly, you are saying Machine = HAL in Zerynth, and I should replace calls in the code with the Zerynth HAL codes? For a noobie like me it’s a little tough.

Is there a mapping between the two available somewhere? I love working on Zerynth, but it’s a little confusing at times to see what needs to be done to make the code run.

Cheers,

Heikki


#5

Hi @Heikki_Hietala,

Zerynth and MicroPython are two different project, what Daniele was suggesting in this discussion is that you could take MicroPython scripts and convert them to Zerynth scripts with little effort.

This is not of course a standard procedure if you start with a Zerynth project or with Zerynth code.
You can take a look at our programming guide and our examples to understand what Zerynth functions are needed to access hardware peripherals.

Let me know :slight_smile:


#6

Hi! I got the conversion to go, because I can build and upload fine now. And the screen lights up too, but the main program hangs in the lcd screen initialization phase. I asked dhylands on git about this, but haven’t heard back from him yet. I’ll keep you posted.