在本篇中,你将可以在手边没有硬件的情况下对pikascript进行上手测试。 测试使用keil5的仿真工程,仿真目标板为stm32f103,下载仿真工程即可直接开始测试。 ## (1) 下载工程 进入stm32 demo 仓库 (右键在新标签页中打开) [pikascript-stm32-demo](../../../../pikascript-demo-stm32) 然后下载源码 ![MJ8Y8RH0P@ILH~_E}TK5Q57](https://user-images.githubusercontent.com/88232613/130744247-2f71ba72-2d1b-49d9-bbb5-4eda334ec912.png) (github 页面) ![image](https://user-images.githubusercontent.com/88232613/130744477-e6760afb-99bf-4be0-aa04-8fbe2ea737ec.png) (gitee 页面) 本篇的测试只需要解压simulation-keil工程即可 ![image](https://user-images.githubusercontent.com/88232613/130745409-364d67b8-04a4-45ab-bdd0-c59179419717.png) 直接打开工程 ![image](https://user-images.githubusercontent.com/88232613/130745821-864038df-d8b0-41d2-97e8-199815d0d57d.png) ## (2) 运行仿真工程 选择使用仿真器进行调试 ![image](https://user-images.githubusercontent.com/88232613/130747706-b912e09f-3f68-495a-a69f-f8f7500b1e4e.png) 编译工程然后进入调试 ![3MT68@ }AWJTGAYJA12VG%V](https://user-images.githubusercontent.com/88232613/130747350-70ffa319-f04d-4f26-a75b-61864a19b8d8.png) 打开串口显示面板 ![image](https://user-images.githubusercontent.com/88232613/130747952-42073ba1-c4c4-4acb-9495-766cd5731374.png) 运行然后查看输出结果 ![image](https://user-images.githubusercontent.com/88232613/130748221-53fff9f6-6427-417d-b95a-3fa52a57eeaf.png) ## (3) 改改脚本看看 用任意编辑器打开main.py推荐vscode, 没有vscode用记事本打开也可以 ![image](https://user-images.githubusercontent.com/88232613/130748847-477facfb-e16e-4e0e-8876-d66efd0ae48c.png) ``` 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() ```