2021-12-01 18:38:41 +08:00
|
|
|
|
<p align="center">
|
2021-12-01 18:49:40 +08:00
|
|
|
|
<img alt="logo" src="https://user-images.githubusercontent.com/88232613/144221063-a85b2cb0-0416-493f-9afb-56cff31e977d.jpg" width="300">
|
2021-12-01 18:38:41 +08:00
|
|
|
|
</p>
|
|
|
|
|
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">PikaScript</h1>
|
|
|
|
|
<h4 align="center">跨平台的超轻量级嵌入式Python引擎</h4>
|
|
|
|
|
<p align="center">
|
|
|
|
|
<a href="https://gitee.com/lyon1998/pikascript/stargazers"><img src="https://gitee.com/lyon1998/pikascript/badge/star.svg?theme=gvp"></a>
|
|
|
|
|
<a href="https://gitee.com/lyon1998/pikascript/members"><img src="https://gitee.com/lyon1998/pikascript/badge/fork.svg?theme=gvp"></a>
|
|
|
|
|
<a href="https://github.com/pikastech/pikascript/stargazers"><img src="https://img.shields.io/github/stars/pikastech/pikascript?style=flat-square&logo=GitHub"></a>
|
|
|
|
|
<a href="https://github.com/pikastech/pikascript/network/members"><img src="https://img.shields.io/github/forks/pikastech/pikascript?style=flat-square&logo=GitHub"></a>
|
|
|
|
|
<a href="https://github.com/pikastech/pikascript/blob/master/LICENSE"><img src="https://img.shields.io/github/license/pikastech/pikascript.svg?style=flat-square"></a>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p align="center">
|
2021-12-03 09:02:00 +08:00
|
|
|
|
<a href="https://whycan.com/f_55.html" >论坛</a> |
|
2021-12-07 14:14:07 +08:00
|
|
|
|
<a href="https://www.yuque.com/liang-mltek/pikascript/nz7dgl" >文档中心</a> |
|
2021-12-03 09:10:56 +08:00
|
|
|
|
<a href="https://space.bilibili.com/5365336/channel/detail?cid=202329">视频中心</a> |
|
2021-12-09 02:53:22 +00:00
|
|
|
|
<a href="https://www.yuque.com/liang-mltek/pikascript/of8izq">包管理器</a> |
|
2021-12-09 10:24:30 +08:00
|
|
|
|
<a href="https://www.yuque.com/liang-mltek/pikascript/wcc36r" >rtthread软件包</a> |
|
|
|
|
|
<a href="https://www.yuque.com/liang-mltek/pikascript/il3an0" >参与贡献</a> |
|
2021-12-08 19:39:17 +08:00
|
|
|
|
<a href="https://www.yuque.com/liang-mltek/pikascript/cp1k24">商业合作</a>
|
2021-12-01 18:38:41 +08:00
|
|
|
|
</p>
|
2021-09-23 00:16:49 +08:00
|
|
|
|
|
2021-10-24 00:05:52 +08:00
|
|
|
|
# 1.简介
|
|
|
|
|
|
2021-12-01 18:38:41 +08:00
|
|
|
|
PikaScript是一个完全重写的超轻量级python引擎,零依赖,零配置,可以在少于4KB的RAM下运行(如stm32g030c8和stm32f103c8),极易部署和扩展,具有大量的中文文档和视频资料。
|
2021-11-13 15:51:26 +08:00
|
|
|
|
|
2021-10-24 00:05:52 +08:00
|
|
|
|
![output_Kgj52R](https://user-images.githubusercontent.com/88232613/132940452-d07d766c-5aa7-4187-96f2-66b02984e82c.gif)
|
|
|
|
|
|
|
|
|
|
<img src="https://user-images.githubusercontent.com/88232613/137866679-642e4e74-c373-4880-9d97-20dfefeafc18.png" width="500"/>
|
|
|
|
|
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/138021445-13643518-b0a3-4872-a290-5dec27697837.png)
|
|
|
|
|
|
2021-11-09 13:32:55 +08:00
|
|
|
|
# 获取PikaScript:
|
|
|
|
|
|
|
|
|
|
## 使用Pika包管理器[PikaPackage.exe](../../raw/master/tools/pikaPackageManager/pikaPackage.exe)
|
|
|
|
|
|
|
|
|
|
1. 直接运行[PikaPackage.exe](../../raw/master/tools/pikaPackageManager/pikaPackage.exe), 自动下载并更新pikaScript主仓库(文件在当前磁盘的/tmp/pikaScript文件夹)
|
|
|
|
|
|
|
|
|
|
2. 将[requestment.txt](/bsp/stm32g030c8/pikascript/requestment.txt)放在[PikaPackage.exe](../../raw/master/tools/pikaPackageManager/pikaPackage.exe)同一文件夹下, 运行[pikaPackage.exe](../../raw/master/tools/pikaPackageManager/pikaPackage.exe), 自动在当前目录下安装[内核](../../tree/master/src)、[预编译器](../../tree/master/tools/pikaCompiler)与[模块](../../tree/master/package)。
|
|
|
|
|
|
|
|
|
|
3. 已发布的模块列表:[packages.toml](/packages.toml)
|
|
|
|
|
|
2021-11-11 15:02:32 +08:00
|
|
|
|
# 快速上手
|
2021-11-11 14:42:59 +08:00
|
|
|
|
|
2021-11-11 15:02:32 +08:00
|
|
|
|
可使用[仿真工程](document/1.三分钟快速上手.md)快速上手,无需硬件,也可以使用官方支持的开发板[Pika派—Zero](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4023-23991764790.10.16f97c58fsLjVk&id=654947372034),上手即玩。
|
2021-11-11 14:42:59 +08:00
|
|
|
|
|
2021-11-11 15:02:32 +08:00
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/141252834-93011ca7-f84b-4192-8e61-0e242796f62c.png)
|
2021-11-11 14:42:59 +08:00
|
|
|
|
|
2021-11-11 15:02:32 +08:00
|
|
|
|
开发板基于STM32G030C8T6小资源MCU,仅64kB Flash,8kB RAM即可运行完整解释器,和完整的外设驱动(GPIO、TIME、IIC、RGB、KEY、LCD、RGB)。板载CH340 USB转串口芯片,Type-C接口,支持串口下载python脚本,板载4颗RGB灯,可选配[LCD屏幕](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-23991764791.12.16f97c58fsLjVk&id=660745643102)。
|
2021-11-11 14:42:59 +08:00
|
|
|
|
|
2021-11-22 21:59:24 +08:00
|
|
|
|
[Pika派python编程游玩指南](document/7.Pika%E6%B4%BE%E5%BC%80%E5%8F%91%E6%9D%BF%E6%B8%B8%E7%8E%A9%E6%8C%87%E5%8D%97%EF%BC%8C%E5%88%B0%E6%89%8B%E7%9A%84%E5%BC%80%E5%8F%91%E6%9D%BF%E7%8E%A9%E8%B5%B7%E6%9D%A5%EF%BC%81.md)
|
|
|
|
|
|
2021-12-04 10:22:35 +08:00
|
|
|
|
# 开发手册
|
|
|
|
|
|
|
|
|
|
### [点此进入文档中心](https://www.yuque.com/liang-mltek/pikascript)
|
|
|
|
|
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/144693400-99f9c038-76fd-4d95-b3d2-137bd972d580.png)
|
|
|
|
|
|
2021-10-23 23:48:33 +08:00
|
|
|
|
# 视频教程
|
|
|
|
|
|
2021-12-04 10:19:34 +08:00
|
|
|
|
### [点此进入视频中心](https://space.bilibili.com/5365336/channel/detail?cid=202329)
|
2021-12-04 10:17:15 +08:00
|
|
|
|
|
2021-11-17 17:28:28 +08:00
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/142173892-35e33f36-413c-4422-8470-b873b7c3bd71.png)
|
|
|
|
|
|
2021-12-04 10:22:35 +08:00
|
|
|
|
# 交流论坛
|
2021-10-03 19:20:02 +08:00
|
|
|
|
|
2021-12-04 10:22:35 +08:00
|
|
|
|
### [点此进入论坛](https://whycan.com/f_55.html)
|
2021-11-25 22:03:00 +08:00
|
|
|
|
|
2021-12-04 10:22:35 +08:00
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/144693543-4aee46c8-b6c8-4282-99c4-e07271a4ba5f.png)
|
2021-11-25 22:10:27 +08:00
|
|
|
|
|
2021-10-01 09:13:31 +08:00
|
|
|
|
## 文件目录
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[src](../../tree/master/src) - 内核源码
|
2021-10-04 01:13:45 +08:00
|
|
|
|
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[bsp](../../tree/master/bsp) - 裸机芯片/板卡支持
|
2021-10-04 01:13:45 +08:00
|
|
|
|
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[port](../../tree/master/port) - 操作系统支持
|
2021-10-01 09:13:43 +08:00
|
|
|
|
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[document](../../tree/master/document) - 开发文档
|
2021-10-01 09:13:43 +08:00
|
|
|
|
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[examples](../../tree/master/examples) - 示例脚本
|
2021-10-01 09:13:43 +08:00
|
|
|
|
|
2021-10-04 01:21:48 +08:00
|
|
|
|
[package](../../tree/master/package) - 模块目录
|
2021-10-04 01:14:52 +08:00
|
|
|
|
|
2021-10-04 09:42:46 +08:00
|
|
|
|
[pikaCompiler](../../tree/master/tools/pikaCompiler) - 使用rust编写的预编译器
|
2021-10-01 09:13:43 +08:00
|
|
|
|
|
2021-10-04 09:42:46 +08:00
|
|
|
|
[pikaPackageManager](../../tree/master/tools/pikaPackageManager) - 使用go编写的模块管理器
|
2021-09-23 00:17:12 +08:00
|
|
|
|
|
2021-12-02 09:35:41 +08:00
|
|
|
|
# 2.平台支持
|
|
|
|
|
|MCU/Board|bsp|gpio|uart|pwm|adc|i2c|spi|rgb|lcd|arm-2d|
|
|
|
|
|
|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|[PikaPi Zero](https://item.taobao.com/item.htm?spm=a230r.1.14.1.4f2e27a8R0qWJn&id=654947372034&ns=1&abbucket=15#detail)|√|√|√|√|√|√| |√|√|√|
|
|
|
|
|
|stm32g030c8|√|√|√|√|√|√| | | | |
|
|
|
|
|
|stm32g070cB|√|√|√|√|√| | | | | |
|
|
|
|
|
|stm32f103c8|√|√|√|√|√| | | | | |
|
|
|
|
|
|ch32v103r8t6|√|√| | | | | | | | |
|
|
|
|
|
|QEMU|√| | | | | | | | |√|
|
|
|
|
|
|cm32m101a|√| | | | | | | | | |
|
|
|
|
|
|w801|√| | | | | | | | | |
|
2021-12-02 16:02:02 +08:00
|
|
|
|
|apm32f030r8|√| | | | | | | | | |
|
2021-12-02 17:58:03 +08:00
|
|
|
|
|apm32e103vb|√| | | | | | | | | |
|
2021-12-02 23:20:39 +08:00
|
|
|
|
|bl-706|√| | | | | | | | | |
|
2021-12-02 16:02:02 +08:00
|
|
|
|
|
2021-09-18 22:14:17 +08:00
|
|
|
|
# 3.特性
|
2021-09-07 08:55:06 +08:00
|
|
|
|
### (1)运行环境
|
2021-09-07 08:54:06 +08:00
|
|
|
|
|
2021-09-07 19:03:58 +08:00
|
|
|
|
支持裸机运行,可运行于 **RAM ≥ 4kB** ,**FLASH ≥ 32kB** 的mcu中,如stm32g030, stm32f103c8t6,esp8266。
|
2021-08-26 16:28:09 +08:00
|
|
|
|
|
2021-09-07 08:55:06 +08:00
|
|
|
|
### (2)开发环境
|
2021-09-27 11:27:11 +08:00
|
|
|
|
支持串口下载Python脚本。
|
|
|
|
|
|
2021-09-27 11:28:35 +08:00
|
|
|
|
<img src="https://user-images.githubusercontent.com/88232613/134841230-85de6734-8467-4245-93a5-d452b5022b42.gif" width="400" alt="微信交流群"/><br/>
|
2021-09-07 08:54:06 +08:00
|
|
|
|
|
2021-09-06 22:48:51 +08:00
|
|
|
|
支持Keil、IAR、rt-thread studio、segger embedded studio等IDE开发。
|
|
|
|
|
|
|
|
|
|
支持CMake、makeFile、Scons等构建工具
|
2021-09-06 20:22:17 +08:00
|
|
|
|
|
2021-09-06 20:29:42 +08:00
|
|
|
|
零依赖,零配置,开箱即用,极易集成进已有的C工程。
|
2021-09-06 20:26:35 +08:00
|
|
|
|
|
2021-09-06 20:25:49 +08:00
|
|
|
|
极易拓展自定义的C原生函数。
|
|
|
|
|
|
2021-09-07 08:54:06 +08:00
|
|
|
|
支持跨平台,可在linux环境开发内核。
|
|
|
|
|
|
2021-09-07 08:55:06 +08:00
|
|
|
|
### (3)语法特性
|
2021-09-07 08:54:06 +08:00
|
|
|
|
|
2021-08-27 10:15:35 +08:00
|
|
|
|
使用python3标准语法的子集。
|
|
|
|
|
|
2021-10-04 09:42:46 +08:00
|
|
|
|
在编译时支持python类和方法定义,完整支持封装、继承、多态、模块功能 - 基于[Pika预编译器](../../tree/master/tools/pikaCompiler)。
|
2021-08-27 10:11:19 +08:00
|
|
|
|
|
2021-10-04 09:42:46 +08:00
|
|
|
|
在运行时支持python方法调用、变量定义、对象构造、对象释放、控制流(if\while) - 基于[Pika运行时内核](../../tree/master/src/package/pikascript/pikascript-core)。
|
2021-08-09 09:45:59 +08:00
|
|
|
|
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|语法|编译时|运行时|
|
|
|
|
|
|---|---|---|
|
|
|
|
|
|类定义|√| |
|
|
|
|
|
|类继承|√| |
|
2021-11-02 10:33:26 +08:00
|
|
|
|
|方法定义|√|√|
|
|
|
|
|
|方法重载|√|√|
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|方法调用|√|√|
|
|
|
|
|
|模块导入|√|√|
|
|
|
|
|
|参数定义|√|√|
|
|
|
|
|
|参数赋值|√|√|
|
|
|
|
|
|对象新建|√|√|
|
|
|
|
|
|对象销毁|√|√|
|
|
|
|
|
|对象嵌套|√|√|
|
|
|
|
|
|
2021-10-25 16:19:35 +08:00
|
|
|
|
#### 操作符
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|
2021-11-28 17:45:51 +08:00
|
|
|
|
| + | - | * | / | == | > | < | >= | <= | % | ** | // | != | & | >> | << | and | or | not | += | -= | *= | /= |
|
|
|
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√|√| | | | |
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|
2021-10-25 16:19:35 +08:00
|
|
|
|
#### 控制流
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|
2021-12-02 11:17:25 +08:00
|
|
|
|
| if | while | for | else | elif | break | continue |
|
|
|
|
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
|
|
|
|√|√| | | | | |
|
2021-10-25 16:18:23 +08:00
|
|
|
|
|
2021-09-07 08:55:06 +08:00
|
|
|
|
### (4)源码规范
|
2021-08-02 14:03:52 +08:00
|
|
|
|
|
2021-09-06 20:32:46 +08:00
|
|
|
|
注重源码可读性,命名规范,标准统一,完全不使用宏,几乎不使用全局变量。
|
2021-08-05 13:54:12 +08:00
|
|
|
|
|
2021-08-26 16:28:09 +08:00
|
|
|
|
完整的googletest单元测试。
|
2021-08-05 13:54:12 +08:00
|
|
|
|
|
2021-10-06 08:07:12 +08:00
|
|
|
|
# 4.交流与技术支持:
|
2021-08-05 14:20:07 +08:00
|
|
|
|
|
2021-10-02 08:49:35 +08:00
|
|
|
|
## 微信交流群
|
2021-09-09 21:06:10 +08:00
|
|
|
|
|
2021-10-02 08:49:35 +08:00
|
|
|
|
![微信截图_20210917133247](https://user-images.githubusercontent.com/88232613/133729804-e1d0406b-a859-4ebc-b335-477e9c03810e.png)
|
|
|
|
|
|
|
|
|
|
### 群已经满啦,加我QQ拉你进群~ qq: 645275593
|
2021-08-05 14:23:22 +08:00
|
|
|
|
|
2021-08-30 10:36:07 +08:00
|
|
|
|
## Tencent QQ: 645275593
|
|
|
|
|
|
2021-10-23 23:49:40 +08:00
|
|
|
|
## Tencent QQ Group:
|
|
|
|
|
|
|
|
|
|
<img src="https://user-images.githubusercontent.com/88232613/136304186-e49610e4-ce01-4524-99b6-b56842d56411.png" width="300" alt="微信交流群"/><br/>
|
|
|
|
|
|
2021-08-30 10:36:07 +08:00
|
|
|
|
## E-mail: 645275593@qq.com
|
|
|
|
|
|
2021-10-06 08:07:12 +08:00
|
|
|
|
# 5.贡献者
|
2021-09-09 20:37:30 +08:00
|
|
|
|
| 内容 | 贡献者 |
|
|
|
|
|
| --- | --- |
|
2021-12-11 09:37:48 +00:00
|
|
|
|
| 捐赠:智龙开发板 | 龙芯俱乐部 石南 |
|
|
|
|
|
| package:STM32F1 | [sjy](https://gitee.com/shanjiayang) |
|
|
|
|
|
| package: STM32F103RBBooter | [sjy](https://gitee.com/shanjiayang) |
|
|
|
|
|
| bsp: stm32f103rb | [sjy](https://gitee.com/shanjiayang) |
|
2021-11-02 09:46:32 +08:00
|
|
|
|
| 基于QEMU的ARM-2D仿真工程 | [liuduanfei](https://github.com/liuduanfei) |
|
2021-10-10 09:54:24 +08:00
|
|
|
|
| 捐赠:GD32E103TB芯片2片 | 信息牛(微信名) |
|
2021-10-10 09:53:43 +08:00
|
|
|
|
| Rt-thread 支持包模板| [Meco Jianting Man](https://github.com/mysterywolf) |
|
2021-10-05 09:05:47 +08:00
|
|
|
|
| 捐赠:移远EC600S-CN 4G模块 | 移远模块 |
|
2021-09-28 18:39:40 +08:00
|
|
|
|
| 捐赠:博流BL706 开发板|博流智能 [bouffalolab](https://github.com/bouffalolab)|
|
2021-09-22 11:45:01 +08:00
|
|
|
|
| 捐赠:中国移动CM32M101A 开发板| 孟巍(微信名) |
|
2021-09-13 15:07:12 +08:00
|
|
|
|
| 捐赠:APM32F030R8 开发板 | 极海半导体 陈成 |
|
|
|
|
|
| 捐赠:APM32E103VB 开发板 | 极海半导体 陈成 |
|
2021-09-13 18:16:02 +08:00
|
|
|
|
| 捐赠:APEX-Link仿真器 | 极海半导体 陈成 |
|
2021-09-24 16:06:34 +08:00
|
|
|
|
| 源码格式化,增加git属性文件 | [Meco Jianting Man](https://github.com/mysterywolf) |
|
2021-09-13 15:07:12 +08:00
|
|
|
|
| demo/simulation-keil | 千帆(微信名) |
|
2021-09-09 20:36:51 +08:00
|
|
|
|
| demo/stm32f103zet6/demo01-led-stm32f103zet6 | [甜航](https://github.com/easyzoom) |
|
2021-09-09 20:38:11 +08:00
|
|
|
|
| demo/stm32f103zet6/demo02-led-stm32f103zet6_tworoot | [甜航](https://github.com/easyzoom) |
|
2021-09-09 20:38:45 +08:00
|
|
|
|
| demo/stm32f407zgt/demo01-led-stm32f407vgt | [甜航](https://github.com/easyzoom) |
|
2021-09-13 15:07:12 +08:00
|
|
|
|
|
2021-10-06 08:07:12 +08:00
|
|
|
|
# 6.内核测试与开发
|
2021-09-13 15:07:12 +08:00
|
|
|
|
|
2021-10-01 09:09:43 +08:00
|
|
|
|
## linux下测试pikascript内核(推荐ubuntu20.04):
|
|
|
|
|
|
|
|
|
|
step1: 拉取项目
|
|
|
|
|
``` shell
|
2021-10-01 09:10:17 +08:00
|
|
|
|
git clone https://github.com/pikastech/pikascript
|
2021-10-04 09:42:46 +08:00
|
|
|
|
cd pikascript/src
|
2021-10-01 09:09:43 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
step2: 编译项目
|
|
|
|
|
```
|
|
|
|
|
sh init.sh # 第一次编译前运行,之后就不用运行了
|
|
|
|
|
sh make.sh # 编译项目
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
step3: 运行单元测试
|
|
|
|
|
``` shell
|
|
|
|
|
sh test.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
step4: 运行基准测试
|
|
|
|
|
``` shell
|
|
|
|
|
sh test-banchmark.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
step5: 运行demo
|
|
|
|
|
``` shell
|
2021-10-04 09:42:46 +08:00
|
|
|
|
./build/src/boot/demo06-pikamain/pikascript_demo06-pikamain
|
2021-10-01 09:09:43 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-10 09:51:42 +08:00
|
|
|
|
# 7.Demo展示
|
2021-09-13 09:47:39 +08:00
|
|
|
|
|
|
|
|
|
## Demo 01 万物起源点个灯
|
|
|
|
|
|
|
|
|
|
![mmexport1631351506111](https://user-images.githubusercontent.com/88232613/132943903-b3558929-a107-4a99-bdc4-1b3fd3f7172b.png)
|
|
|
|
|
|
|
|
|
|
![Hnet-image (2)](https://user-images.githubusercontent.com/88232613/132943428-f2b365ca-140e-42f4-936c-db6a7d9f8dee.gif)
|
|
|
|
|
|
|
|
|
|
## Demo 02 串口测试
|
|
|
|
|
|
|
|
|
|
![mmexport1631351902469](https://user-images.githubusercontent.com/88232613/132944132-90898355-de94-4d81-990b-7b85d4a4d08a.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![Hnet-image (3)](https://user-images.githubusercontent.com/88232613/132943365-0f7059b3-4f9d-4989-a5ec-2cce72b0cc96.gif)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Demo 03 读个ADC试试
|
|
|
|
|
|
|
|
|
|
![mmexport1631351527609](https://user-images.githubusercontent.com/88232613/132944180-a805c8f8-40d5-45ff-ae2a-a0fe8f9db1ab.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![mmexport1631351523907](https://user-images.githubusercontent.com/88232613/132944185-0a01b1ba-8cf7-4f9f-9d73-fe9cbcd52f0b.png)
|
|
|
|
|
|
|
|
|
|
|
2021-09-23 14:14:14 +08:00
|
|
|
|
## Demo 04 PWM输出
|
|
|
|
|
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/134461673-975498f4-09de-4f3a-866d-53e6fa1307b1.png)
|
|
|
|
|
|
|
|
|
|
## Demo 05 RGB流水灯
|
|
|
|
|
|
2021-09-23 14:16:08 +08:00
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/134461950-2153c738-0661-452f-956a-65a88fb71592.png)
|
|
|
|
|
|
2021-10-10 09:51:42 +08:00
|
|
|
|
这几个Demo占用的RAM最大值只有3.56K,把1K的堆栈也算上就是4.56K,Flash最大占用是30.4K,以STM32F103C8T6的20K RAM和64K Flash为标准,RAM才用掉不到25%,Flash才用掉不到50%。
|
2021-09-23 14:14:14 +08:00
|
|
|
|
|
2021-10-10 09:51:42 +08:00
|
|
|
|
我们可以简单对比一下micropython的常用芯片STM32F405RG和这次跑PikaScript的芯片STM32G070CB
|
2021-09-13 09:47:39 +08:00
|
|
|
|
|
|
|
|
|
## RAM资源对比
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/132944731-a55ece1d-061f-4b91-ba87-bd6547be96a7.png)
|
|
|
|
|
|
|
|
|
|
## Flash资源对比
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/132944745-e9cf598d-e75f-40bb-873e-911819d535b7.png)
|
|
|
|
|
|
|
|
|
|
## 参考价对比(以2021年9月11日立创商城10片售价为参考)
|
|
|
|
|
![image](https://user-images.githubusercontent.com/88232613/132944757-2b5cfda8-f93f-4456-8d7f-4e4767954056.png)
|
|
|
|
|
|
|
|
|
|
## 拓展能力如何呢?
|
|
|
|
|
|
|
|
|
|
除了设备驱动之外,为mcu开发自定义的python脚本绑定在pikascript的开发框架下非常轻松,下面两个Demo就是自定义的C模块拓展,这个Demo基于ARM-2D图像驱动库开发了一些python脚本接口。
|
|
|
|
|
|
|
|
|
|
## 几个小方块~
|
|
|
|
|
![Hnet-image (7)](https://user-images.githubusercontent.com/88232613/132945282-bfd310df-8063-456d-b90c-6b798a2c8ed5.gif)
|
|
|
|
|
|
|
|
|
|
## 几个旋转太阳~
|
|
|
|
|
![Hnet-image (6)](https://user-images.githubusercontent.com/88232613/132945107-e473a2cc-9fbc-47f9-aaed-a28d3ad1048c.gif)
|
|
|
|
|
|