First steps for an interactive micropython ... IPython
Posted: Thu Apr 02, 2015 4:30 pm
Hi,
I was looking for an way to use micropython and the pyboards in classes.
There are some challenges:
1. Students are not always comfortable with the command line.
2. Creating a more interactive teaching environment, that is theory together with interactive code.
3. Being able to share and access within a classroom network.
All those points (and many more) are on the list for ipython. Thus, I was wondering if there is a way to use micropython within ipython. I read a bit and luckily this seems to be easier as expected.
Below you see the very first ipython notebook talking to an micropython kernel.
Be aware that this version of micropython is the unix port running on the host PC. Thus, next steps will be to access a micropython running on a pyboard. After that we should have a nice set of possibilities. E.g. students can access a pyboards attached to other PCs, web-based interactive programming at a low hardware level, creating of course-materials which can interactively access a pyboard for hand-on experiments. I also want to add to save a ipython session directly on a pyboard, thus after an session of interactive fiddling, testing and debugging, one could load the final result on the pyboard to execute it standalone.
This is just the very beginning, there is a lot of room for further improvements like code completion, interactive plots of e.g. ADC data. However, it is a start. I will try to get the pyboard working next and after that one can think of more whistle and bells. Building on the shoulders of giants here... thanks to Micropython and ipyhton, I am just adding some glue
I was looking for an way to use micropython and the pyboards in classes.
There are some challenges:
1. Students are not always comfortable with the command line.
2. Creating a more interactive teaching environment, that is theory together with interactive code.
3. Being able to share and access within a classroom network.
All those points (and many more) are on the list for ipython. Thus, I was wondering if there is a way to use micropython within ipython. I read a bit and luckily this seems to be easier as expected.
Below you see the very first ipython notebook talking to an micropython kernel.
Be aware that this version of micropython is the unix port running on the host PC. Thus, next steps will be to access a micropython running on a pyboard. After that we should have a nice set of possibilities. E.g. students can access a pyboards attached to other PCs, web-based interactive programming at a low hardware level, creating of course-materials which can interactively access a pyboard for hand-on experiments. I also want to add to save a ipython session directly on a pyboard, thus after an session of interactive fiddling, testing and debugging, one could load the final result on the pyboard to execute it standalone.
This is just the very beginning, there is a lot of room for further improvements like code completion, interactive plots of e.g. ADC data. However, it is a start. I will try to get the pyboard working next and after that one can think of more whistle and bells. Building on the shoulders of giants here... thanks to Micropython and ipyhton, I am just adding some glue