Is there a way to program microcontroller with python code?  - Page 1
Forum section: electronics / general

author: samdare
author_rank: Contributor
timestamp: March 30, 2018, 09:25:46 pm
content: I am sort of good at python compared to C++,assembly and C and actually I love python compared to all other languages (no specific reason).So I just want to club python and embedded electronics is there a way that python hooks with microcontroller or vice versa :-DSent from my Lenovo K8 Plus using Tapatalk

author: lgbeno
author_rank: Frequent Contributor
timestamp: March 30, 2018, 09:28:49 pm
content: Yeshttps://learn.adafruit.com/welcome-to-circuitpython/what-is-circuitpythonSent from my iPhone using Tapatalk Pro

author: Jeroen3
author_rank: Super Contributor
timestamp: March 30, 2018, 09:30:46 pm
content: Unlikely. There are some projects doing javascript though.In general, running an interpreted language on a microcontroller is highly inefficient. If interpreted languages are used, they are often limited to user programmable equations in larger programs. Eg: A PLC formula fields.Just learn to type { and ; instead of  and you'll be good to go!

author: samdare
author_rank: Contributor
timestamp: March 30, 2018, 09:31:17 pm
content: Quote from: lgbeno on March 30, 2018, 09:28:49 pmJust had a glance, looks cool ,thanksSent from my Lenovo K8 Plus using Tapatalk

author: samdare
author_rank: Contributor
timestamp: March 30, 2018, 09:32:47 pm
content: Quote from: Jeroen3 on March 30, 2018, 09:30:46 pm quality humor.Sent from my Lenovo K8 Plus using Tapatalk

author: samdare
author_rank: Contributor
timestamp: March 30, 2018, 09:35:35 pm
content: Quote from: Jeroen3 on March 30, 2018, 09:30:46 pmJavaScript!!,repository names?Sent from my Lenovo K8 Plus using Tapatalk

author: Jeroen3
author_rank: Super Contributor
timestamp: March 30, 2018, 10:06:00 pm
content: https://www.espruino.com/is one of them.

author: samdare
author_rank: Contributor
timestamp: March 30, 2018, 10:10:12 pm
content: Quote from: Jeroen3 on March 30, 2018, 10:06:00 pmThanksSent from my Lenovo K8 Plus using Tapatalk

author: abraxa
author_rank: Frequent Contributor
timestamp: March 31, 2018, 08:01:59 am
content: There's alsohttp://micropython.org/- it's the foundation for thehttps://openmv.io/,for example.

author: samdare
author_rank: Contributor
timestamp: March 31, 2018, 08:05:07 am
content: Quote from: abraxa on March 31, 2018, 08:01:59 amThe openmv site outdated ,404 errorSent from my Lenovo K8 Plus using Tapatalk

author: brtmr
author_rank: Newbie
timestamp: March 31, 2018, 09:21:59 pm
content: This thinghttps://en.wikipedia.org/wiki/Micro_Bitwas handed to me at a Python conference last year. Developed for UK schoolkids to learn programming. Maybe it could also be for programmers who want to get started on microcontrollers?Edit: This is the online IDE you can use:http://python.microbit.org/v/1Website IDE turns your Python code into a downloadable binary blob, you plug in your micro into your PC, it shows up as a hard drive, you copy the blob to the drive, done.

author: igendel
author_rank: Frequent Contributor
timestamp: March 31, 2018, 09:55:32 pm
content: As mentioned, there's CircuitPython and MicroPython, each with its "native" boards. The difference, to the best of my knowledge, is that MicroPython was optimized specifically for MCUs in some ways, while CircuitPython tries to stay true(r) to the original Python syntax.Both areverylimited. Obviously you can't just import any Python library, and what youdohave will be slow and heavy on the microcontrollers' resources. I've done a couple of little demo projects on the BBC Micro:bit and a Pyboard clone from China. It's fun, arguably excellent for getting children interested in embedded/programming, but for more serious work you'll hit the limitations of these languages very fast.

author: e100
author_rank: Frequent Contributor
timestamp: April 04, 2018, 09:53:32 am
content: Quote from: igendel on March 31, 2018, 09:55:32 pmCircuitPython = MicroPython + Adafruit's device drivers for talking to Adafruit developed hardware.

author: e100
author_rank: Frequent Contributor
timestamp: April 04, 2018, 10:07:01 am
content: Quote from: samdare on March 30, 2018, 09:25:46 pmDo a Google search for "micropython memory fragmentation" before going down this road.If high reliability is important, then Python may not be the best solution.

author: igendel
author_rank: Frequent Contributor
timestamp: April 04, 2018, 10:31:22 am
content: Quote from: e100 on April 04, 2018, 09:53:32 amAh, found it:https://theamphour.com/383-an-interview-with-scott-shawcroft/(from 28:00)