MicroPython
MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.
The MicroPython pyboard is a compact electronic circuit board that runs MicroPython on the bare metal, giving you a low-level Python operating system that can be used to control all kinds of electronic projects.
MicroPython is packed full of advanced features such as an interactive prompt, arbitrary precision integers, closures, list comprehension, generators, exception handling and more. Yet it is compact enough to fit and run within just 256k of code space and 16k of RAM.
MicroPython aims to be as compatible with normal Python as possible to allow you to transfer code with ease from the desktop to a microcontroller or embedded system.
pybv10-pinout.jpg (443.55 KB, 下载次数: 20)
下载附件
2016-12-21 11:00 上传
如果做成这样的形式,我觉得拿来做点小东西挺方便的,,跟Arduino差不多
安全是指?
效率这个就需要考究一下了,毕竟多了一层解析
目前我所接触的micropython就是简单的进行一下外设的控制与读取,例如串口、i o、IIC device等,可以很快的搭起测试环境,,
下面是一个小例子,,
from pyb import Timer
tim = Timer(1, freq=1000)
tim.counter() # get counter value
tim.freq(0.5) # 0.5 Hz
tim.callback(lambda t: pyb.LED(1).toggle())
用简单的几条代码就实现这个功能,我觉得很多DIY制作,用起来还算不错
一周热门 更多>