Update 1.三分钟快速上手.md

This commit is contained in:
mimilib 2021-08-25 16:04:29 +08:00 committed by GitHub
parent 0976848716
commit 5f353da8a5

View File

@ -88,3 +88,51 @@ mem.now()
![image](https://user-images.githubusercontent.com/88232613/130750476-eaffce03-caeb-40b3-9841-550034fa191a.png)
接下来我们来修改一下main.py看看效果
``` python
from PikaObj import *
import Device
import PikaStdLib
led = Device.LED()
uart = Device.Uart()
mem = PikaStdLib.MemChecker()
print('hello wrold')
uart.setName('com1')
uart.send('My name is:')
uart.printName()
print('mem used max:')
mem.max()
print('mem used now:')
mem.now()
# new code start
print('add new code start')
uart.setName('com2')
uart.printName()
print('add new code end')
# new code end
```
我们在main.py下面新加了4行脚本我们来编译运行看看效果。
编译pikascript-api
![image](https://user-images.githubusercontent.com/88232613/130751195-40944d60-7d56-48a9-9f47-cab87d77d5a8.png)
编译keil工程然后进入调试
![image](https://user-images.githubusercontent.com/88232613/130751539-aa0bdb82-750f-4f98-8f6f-02d653dda64a.png)
运行然后观察输出
![image](https://user-images.githubusercontent.com/88232613/130751653-cad627c2-367c-45a6-8c5f-686c7514df3c.png)
我们发现多了3行输出说明编译运行顺利。
好了到这里pikaScript的三分钟快速上手就结束了。
想要继续学习pikaScript的标准开发流程可以看这里
想要了解如何部署pikaScript到你的工程里面请看这里