Page 1 of 1

Call C functions from Micropython script.

Posted: Mon Nov 24, 2014 7:15 am
by tarun2121
Hello All
I need to call C functions(from some .c file) to micropython script running on STM board. How it could be done?
I tried to call in same way CPython does, But I am getting error while importing C file in python script.

Re: Call C functions from Micropython script.

Posted: Mon Nov 24, 2014 7:51 am
by dhylands
In order to call C from MicroPython (on the pyboard) you need to create a module like the ones in the stmhal directory.

For example: https://github.com/micropython/micropyt ... mhal/led.c

Also see this thread: http://forum.micropython.org/viewtopic. ... =153&p=625