Author Topic: Is there a way to program microcontroller with python code?  (Read 2916 times)

0 Members and 1 Guest are viewing this topic.

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
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 :-D

Sent from my Lenovo K8 Plus using Tapatalk

 
The following users thanked this post: e100

Offline lgbeno

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: 00
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Is there a way to program microcontroller with python code?
« Reply #2 on: March 30, 2018, 09:30:46 pm »
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 [tab] and you'll be good to go!   :P
 

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
Re: Is there a way to program microcontroller with python code?
« Reply #3 on: March 30, 2018, 09:31:17 pm »
Yes https://learn.adafruit.com/welcome-to-circuitpython/what-is-circuitpython


Sent from my iPhone using Tapatalk Pro
Just had a glance, looks cool ,thanks 

Sent from my Lenovo K8 Plus using Tapatalk

 

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
Re: Is there a way to program microcontroller with python code?
« Reply #4 on: March 30, 2018, 09:32:47 pm »
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 [tab] and you'll be good to go!   [emoji14]
[emoji23][emoji23][emoji23] quality humor.

Sent from my Lenovo K8 Plus using Tapatalk

 

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
Re: Is there a way to program microcontroller with python code?
« Reply #5 on: March 30, 2018, 09:35:35 pm »
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 [tab] and you'll be good to go!   [emoji14]
JavaScript!!,repository names?

Sent from my Lenovo K8 Plus using Tapatalk

 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Is there a way to program microcontroller with python code?
« Reply #6 on: March 30, 2018, 10:06:00 pm »
 

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
Re: Is there a way to program microcontroller with python code?
« Reply #7 on: March 30, 2018, 10:10:12 pm »
https://www.espruino.com/ is one of them.
Thanks

Sent from my Lenovo K8 Plus using Tapatalk

 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Is there a way to program microcontroller with python code?
« Reply #8 on: March 31, 2018, 08:01:59 am »
There's also http://micropython.org/ - it's the foundation for the https://openmv.io/, for example.
 

Offline samdareTopic starter

  • Contributor
  • Posts: 25
  • Country: in
Re: Is there a way to program microcontroller with python code?
« Reply #9 on: March 31, 2018, 08:05:07 am »
There's also http://micropython.org/ - it's the foundation for the https://openmv.io/, for example.
The openmv site outdated ,404 error

Sent from my Lenovo K8 Plus using Tapatalk

 

Offline brtmr

  • Newbie
  • Posts: 1
  • Country: de
Re: Is there a way to program microcontroller with python code?
« Reply #10 on: March 31, 2018, 09:21:59 pm »
This thing https://en.wikipedia.org/wiki/Micro_Bit was 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/1

Website 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.
« Last Edit: March 31, 2018, 09:25:14 pm by brtmr »
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: Is there a way to program microcontroller with python code?
« Reply #11 on: March 31, 2018, 09:55:32 pm »
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 are very limited. Obviously you can't just import any Python library, and what you do have 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.
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 

Offline e100

  • Frequent Contributor
  • **
  • Posts: 566
Re: Is there a way to program microcontroller with python code?
« Reply #12 on: April 04, 2018, 09:53:32 am »
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.

CircuitPython = MicroPython + Adafruit's device drivers for talking to Adafruit developed hardware.
 

Offline e100

  • Frequent Contributor
  • **
  • Posts: 566
Re: Is there a way to program microcontroller with python code?
« Reply #13 on: April 04, 2018, 10:07:01 am »
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 :-D


Do 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.
 

Offline igendel

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: il
    • It's Every Bit For Itself (Programming & MCU blog)
Re: Is there a way to program microcontroller with python code?
« Reply #14 on: April 04, 2018, 10:31:22 am »
CircuitPython = MicroPython + Adafruit's device drivers for talking to Adafruit developed hardware.

Ah, found it:
https://theamphour.com/383-an-interview-with-scott-shawcroft/
(from 28:00)
Maker projects, tutorials etc. on my Youtube channel: https://www.youtube.com/user/idogendel/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf