Why we need to retire the blinking LED as the entry into embedded programming
Something that was true since 1985 changed in Q4 of 2018 and we are yet to feel all the repercussions.
* * *
Every ThinkPad, iPhone, Kindle…every Alexa, Nest, Homepod…every DJI Drone, Go PRO or Tamagochi, every Fitbit, every Pebble…every Xbox or Nintendo…every Walkman, every Game Boy, every C64, Amiga or Tandy.
Every piece of electronics which we geeked out about, used, abused, eventually bricked then forgot…
Each and every one of them hails from the same embryo.
The blinking LED.
It used to be the classic “Hello World” of the embedded world.
But for a while now it has been due for an update. An update that would reflect the vanishing boundaries between different domains of software development, as brought on by IoT. Consider Gartner’s prediction: by 2020, 20.4 billion devices will be connected to the Internet. It’s time to replace the LED blink with a “Hello, Cloud.”
We could have spent a few more years debating about it but a major turning point happened in the last quarter of last year, giving us a perfect excuse.
What happened in Q4 of 2018 is that Python became the most popular programming language, according to a 5-minute video that recently went viral. To become number one, Python toppled Java. Java sat on the top spot since 2000 after dethroning C, which in turn knocked down Pascal in 1985.
C and Java are related so the transition between the two is not as interesting as the rise of Python. How did a scripting language replace a comparatively low-level language as the most popular in the world? Will Python seep into all aspects of programming from supercomputers to embedded systems the way C did? And will it have a 33-year run on the top like the c-family of languages?
It’s impossible to tell, of course. But whatever skeptics and detractors may say, Python is more diverse than given credit for. It has only started to show its potential for programming embedded systems. What it lacks in efficiency and speed of execution, it makes up for in speed of development and deployment. And in the world of 32-bit microcontrollers, and short, Agile-based development cycles, this is often a welcome trade-off.
To demonstrate the beauty and elegance of Python in embedded applications, I want to show you the “Hello Cloud” example of Zerynth, a company I work with. Zerynth offers a Python toolchain for embedded and IoT programming.
In just 12 lines of readable Python code, you can connect your device to the cloud and send a message.
In this example, I am sending a “Hello Cloud” message from a Xinabox CW02 board (figure 2) to the OKDO Cloud (one of many possible board and cloud vendor combinations supported by Zerynth):