Both Arduino and MicroPython are giants when it comes to the electronics education area, and each one of them represents something you can’t pass up on as an educator. Arduino offers you a broad ecosystem of cheap hardware with a beginner-friendly IDE, helped by forum posts explaining every single problem that you could and will stumble upon. MicroPython, on the other hand, offers a powerful programming environment ripe for experimentation, and doesn’t unleash a machine gun fire of triangle brackets if you try to parse JSON slightly incorrectly. They look like a match made in heaven, and today, from heaven descends the Arduino Lab for MicroPython.
This is not an Arduino IDE extension – it’s a separate Arduino IDE-shaped app that does MicroPython editing and uploads code to your board from a friendly environment. It works over a serial port, and as such, the venerable ESP8266-based boards shouldn’t be be left out – it even offers file manager capabilities! Arduino states that this is an experimental effort – it doesn’t yet have syntax checks, for instance, and no promises are made. That said, it already is a wonderful MicroPython IDE for beginner purposes, and absolutely a move in the right direction. Want to try? Download it here, there’s even a Linux build!
High-level languages let you build projects faster – perfect fit for someone getting into microcontrollers. Hopefully, what follows is a MicroPython library manager and repository! We’ve first tried out MicroPython in 2016, and it’s come a long way since then – we’ve seen quite a few beginner-friendly MicroPython intros, from a gaming handheld programming course, to a bipedal robot programming MicroPython exploration. And, of course, you can bring your C libraries with you.
“the venerable ESP8266-based boards shouldn’t be be left out”
be be be left out?
All other boards then the ones produced by Arduino SRL are be be be left out?
Any board with MicroPython and REPL over Serial will work, including ESP8266 :)
CircuitPython is being left out.
Oh but seeing what they did, doesn’t seem like it would be hard to add CircuitPython support, especially given it’s already compatible!
CircuitPython is Adafruit’s way of taking their ball home. MicroPython FTW!
Yeah, micropython is the logical choice. If adafruit had simply contributed to micropython rather than redoing and forking we would have something better than both. They just think they can extract more profit if they have their own sandbox to get people to play in. Abominable behaviour. Unfortunately that appears to be kind of what Arduino is doing here, too.
https://github.com/adafruit/circuitpython
This branch is 16412 commits ahead, 1282 commits behind micropython:master.
No opinion either way, would rather just use C/C++ but which one is more “up to date”?
“Abominable behaviour”
No, just wise for-profit business behavior which is what created everything used in Arduinos and Adafruit products and the Ardunio and Adafruit products themselves.
“Unfortunately that appears to be kind of what Arduino is doing here, too.”
See.
Just a note on the “Which one is more committed” comment: CircuitPython is a fork of MicroPython and periodically syncs with upstream, resetting the ‘number of commits behind MicroPython’.
However, very little is pushed upstream so the ‘commits ahead’ will likely continue to increase…forever.
The next time there are pandemic lock-downs and a company other than Adafruit keeps their employees on the payroll anyway (because that would be the normal and expected ethics of the business world), your bad-mouthing might have some validity. Until then, it’s just juvenile sniping.
I saw an interesting post a few weeks back comparing the power consumption of each development language – an important consideration especially on embedded systems that run on battery power. Interpreted languages like Python consume significantly more power than compiled languages like C.
No wonder! That said, I recall that post being dodgy in how it’s made its analysis, sadly, don’t recall what was specifically off about it. Do mind that this is MicroPython, which is written with MCUs in mind and is wildly different from CPython that we run on desktops, in a good way.
It totally depends on the application. Sometimes the high level language is just gluing together the low level components, in which case the high level language has little effect on performance or power consumption. If you design your app this way, it can profile out to less than 1% CPU used by the language. This is an effective strategy that has been used for a long time to get interpreted languages working well on resource constrained systems.
However if you code up tight loops like Bresenhams Algorithm in the high level language, then of course performance and power consumption will be poor.
Thee are 3 ways to dramatically improve uPython performance with each step making it more C-like. https://www.youtube.com/watch?v=hHec4qL00x0
This looks like a fork/rebrading of MU editor (https://codewith.mu/) which has been around for ages for micropython/circuit python.
It isn’t a form of Mu, which is built in Python :)
Arduino Lab for MicroPython is written from scratch.
Its inception is a project by Murilo Polese, credited in our blog post, who coded this whole editor from the ground up as part of the Arduino team
Thonny IDE has this too.
Well, if it fully supports the Wiring Lite, the Arduino Serial or Uno/Uno R3, at least..
https://docs.arduino.cc/retired/boards/arduino-serial
https://arduinohistory.github.io/
You cannot run MicroPython on AVR
You can however run Snek https://sneklang.org/ which is very similar
I am very unconvinced about the choice.
Python is the Jar Jar of the programming languages
Be grateful it’s not javascript.
I find javascript in the form of Espruino much better than arduino/micropython. I is event based so you don’t code everything synchronously in main loop. Much more elegant IMO.
Or, you know, you can use asyncio so you don’t rely on big main loops. _More_ elegant, IMO.
I learned assembly in college and picked up C and C++ after I graduated. Anyone familiar with assembly and RISC architecture will know that’s quite the step up and makes a lot of sense for anyone who writes a lot of code. What I don’t quite understand is why would I switch to python? What are the advantages of python over C that make people spend the time learning a separate language?
Python doesn’t take much learning and there is no compiling to run your code. It all lives on the microcontroller. Great for instant prototypes and trial and error, but not useful for complex coding or ultra fast needs.
Doesn’t take much learning – compared by what? C ? Now way…
The only advantage is see is, that you save the limited reprogramming count of the programm flash memory of the microcontroller, because the python script is stored and running in the RAM.
It’s wonderful in getting projects done quickly (amazing for getting newcomers from “what is this” to “wow I can create things”, it’s suitable for an overwhelming amount of projects that people (especially beginners) have, and the prototyping capabilities (i.e. REPL) are unparalleled.
In technical reasone – nope. But, Assembly language is CPU family depended. If you change the CPU-Type, you must learn it – again and again. You don’t just need to learn just the syntax, you need to learn the details of the entire system. This consumes many many of time.
If you learn C as a programming language, you’re a quite abstract of the used CPU family. But, you must learn how the system and the CPU works. A start from scratch is quite faster in C or PYTHON on a different CPU and system compared by assembler.
But, you must know, that more abstraction comes in hand with more lost of control.
In C, this is quite close to hardware – near similar as in assembler. In PYTHON, your are a lot of more abstract as in C.
The discussion of the best programing language is as old as the languages it self. The best programing language is that, you are know.
Right on. In terms of microcontrollers, Python is nice because you don’t have to spend days or weeks learning all of the minute details of the microcontroller. In exchange, you can’t use advanced special features of the architecture, unless someone provided a module that gives you access.
Personally, I like to code in C, and I enjoy learning the details of various microcontrollers, but when I have a project that I just need to get done fast, Python typically makes that very easy. Maybe C would be cheaper for large scale production, since I could use a cheaper microcontroller, but most of my projects aren’t massive scale things where a few cents for a cheaper microcontroller would make any difference.
My primary languages now days are C and Python. Python was very much worth learning, because it is so much faster to code higher level stuff in. Now, I really like C for a lot of stuff. For my current job, I use C a lot, because we are doing a lot of bit manipulation and complex math, and it needs to be extremely fast. For protyping and testing things, and for making demos, I can write up programs in a day that would take a week in C. I’ve also started writing my C into Python modules, so I can use Python for networking, text parsing, and other things that are really easy to do with Python, but then I can use the C module to do the math stuff that needs to be fast from within Python.
Anyhow, this allows for a highly optimized workflow, where I can move very smoothly between C and Python, to maximize both development speed and product quality.
(To be fair, I also really like programming in assembly, and I’ve been able to use my knowledge of assembly to use advanced instructions in C to further improve math performance. Sadly, I don’t get much opportunity to code in assembly directly. Hopefully someday I’ll have more time for that!)
Don’t forget that you can write inline assembly in MicroPython! Don’t even need to set up a compiler toolchain…
https://docs.micropython.org/en/v1.9.3/pyboard/pyboard/tutorial/assembler.html
We see an approx 20% reduction in development effort by using MicroPython over C. We expect that number to increase as the platform matures.
Well, that’s out of the left field! Without rehashing my previous comment, the “Jar Jar” throne is occupied by things like PHP, Python’s designed quite well. Having used Python in educational environments with great success, I recommend you take a look once again.
I’m very unconvinced by your analogy. :P
“No promises are made”? That’s because it’s python not JavaScript.
what about PlatformIO
https://twitter.com/TektonikaInfo/status/1584891518305046530
Arduino to the rescue to make another horrible IDE for people.
Oh loard, your are so right. In 2012 i had moved tom i51 to atmega and found the arduino ide. A horrible IDE without debugging features. Atmel has distributed their AtmelStudio and this was a VisualStudio Express (now code) and an extension plugin to supports the gnu compiler/debugger framework. An In-System-Debugging System with a coupe of advantages. I had ported some adruino code to Atmel Studio to get the debugging option.
All code in one file…grrrr
Superloop design…grrr
Visual Studio Express and VS Code are completely unrelated.
Also, Atmel Studio wasn’t made from VS Express. Atmel actually licensed Visual Studio 2010 and later 2012 and implemented their platform tools as extensions.
I remember using AVRStudio. Atmel’s IDE before AtmelStudio. It was the best!
#bringbackavrstudio
It would be cool if Arduino fixed the horrid IDE instead of adding more features I won’t use.
Have you seen the 2.0 release?
Unfortunately yes.
I am disappointed to learn that the ESP8266 is now considered “venerable”.
Your favorite rebellious rock and roll anthem from your youth is now background music at the grocery store.
We were the first outlet to cover it 8 years ago!
I made an ESP8266 workshop in Berlin in Oct 2014 https://web.archive.org/web/20151001002456/http://filez.zoobab.com/esp8266/
Geeze, not again. We don’t need fifty different systems that all suck! We need a handful of good ones! Just contribute to the best in class systems, fork them if they aren’t what you want, don’t start all over again unless you have a really compelling reason!
Thonny and micropython currently lack stability, completeness and a ton of important features, and even speed. That’s what’s holding back progress, not yet more me too bits of the ecosystem. You could have done some serious useful with that needs doing, instead you just made a crappy me too of thonny.
The only IDE I’ve ever really enjoyed was Delphi . All my C/C++ programming and Python (and other languages) programming is done with a text Editor. Today that is Notepad++ on the Windows side, and Geany on the Linux side. Never took to VS, Eclipse or other IDEs much. I do use Arduino IDE when I need too, but it is a tool like anything else to get the job done. I don’t complain about it. Anyway a standard text editor works fine for me — C, Python, etc…. and a command line to run/upload
What is the best editor? Like languages discussions:-) I was a fan of emacs/xemacs but Windows integration is hard for sub-processes (fight with cygwin or minsys…) Now I found that Visual Code is quite nice both on Win & Linux. Can even work with the WSL on Win.
Really excited to see where this goes! And how they will choose to differentiate from Thonny, which I have been using, or VSCode which many people use