Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
How to use Python or C on mbed (LPC 1768) instead of c++
Hi - I'd like to use a python script for PWM generation on the LPC1768.
Could someone provide a basic example?
Thanks
5 Answers
9 years, 8 months ago.
There is no python interpreter that works to develop for mbed.
You have to use c...
c is (mostly) a subset of c++. So while mbed is inherently c++ you can write pure c code an it'll run fine.
As for how to use a PWM output, the PWM out hello world example is a good starting point. http://developer.mbed.org/teams/mbed_example/code/PwmOut_HelloWorld/
posted by 17 Apr 20159 years, 8 months ago.
You may take a look at : https://micropython.org/ It's a Python 3.4 running on a STM32F4xx (not a LPC1768 (it may run on a LPC1768 but the lack of RAM drive it quickly to be useless)).
At this time MicroPython runs on the PyBoard baord but also on a STM32F4Discovery or on the Seeed Studio Arch Max. It's an open source project and you could easily adapt it to your needs.
9 years, 8 months ago.
You could look at: https://github.com/nodesign/weio
or http://embeddedpython.org/index.php?title=The_Owl_Embedded_Python_System
or http://viper.thingsoninternet.biz/
9 years, 8 months ago.
Haven't tried it but have a look at pymite here http://developer.mbed.org/users/va009039/code/pymite/.