Main Site Documentation

MicroPython


#1

Has anyone checked this out: http://micropython.org/. It’s an interesting KickStarter project. I’ve often thought about embedding a scripting or macro language (DSL) into my projects. A little “sidecar” board that runs Python or some other scripting language might be cool.

Stacy


#2

Well, NETMF is in fact already a interpreter.
So running a script interpreter in NETMF (interpreter) would be quite inefficient.
Of course it would work.
And for a 1st glimpse: µPython looks like a standalone system. I don’t see how you would be able to run it side by side with NETMF.


#3

I think it was meant to run micropython on a medusa board by the side of a raptor for example, to giver user control of some features or behaviour in a dynamic way…?


#4

Well, this would give the phrase ‘code injection’ a new meaning :wink:

but personally I would prefer Lua


#5

Right, I meant running the board side-by-side. (Sidecar). It looks like there may be an Arduino shield in the works that does just that.

I like Lua as well, but I can deal with Python or even JavaScript. I think it would be cool to write the brains in the system on a Gadgeteer board and write scripts that run on the sidecar board. Imagine a Home Automation controller for example. NETMF could handle the core functions, but you could write scripts that run on a separate board that’s connected to the NETMF system. You could then edit/update the scripts via a web or mobile interface to add rules to the system.

The creator of micropython mentions integrating it into other systems such as arduino.
http://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers/posts/669549.

This may not be the ideal board for what I want, but I like the idea of being able to add scripting capabilities to my project.

Stacy


#6

http://www.eluaproject.net/

It’s possible to download and run C# code without rewriting the firmware, too, you know. You can dynamically load and execute assemblies.


#7

@ godefroi - But you cant create the assemblies on the fly from code.
With Lua or python you could 'generate or input the code on the board directly.


#8

eLua looks pretty interesting. That might be a good candidate for this type of scenario as well. I think one of the keys to making this work would be attaching events from your NETMF project to scripts on the sidecar board. I guess this is a research project for when I have time.

Good discussion!

Stacy


#9

I think SPI might be a good way to communicate.


#10

MicroPython reminds me on project, that I currently working on.
It contains executing gadgeteer elements in runtime.
Whole code flow is described in file, that is read on startup.
If we want to change or add some functionality, we generate another file, and send to microcontroller, which then execute our newly code.
This file is generated by Graphical Programming Language.
For now, I’m testing it on Spider and Octopus.
Preview is here : https://www.youtube.com/watch?v=yzNvugUQX_o


#11

Looks interesting.
At work I’ve created something similar, but in my case it’s more or less sequential processes are described, that can be executed on a trigger like startup, digital input, …


#12

I create this system for non programmers, or lazy programmers, like me :smiley:
so no code is going to be required to write.

There could be multiple parallel executings (start elements), and elements that are draw in this graphical programming language could be simple, like pir sensor, temperature sensor, or complex like element that send data to Android app created for this purpose, element that send data to cloud DB and web app, element that represents multiple sensors (like wheater station), element, where we create c# or c code, whuch is going to be executed…