前一段时间介绍过 Raspberry Pi Pico 模拟器 和 Arduino在线模拟网站 wokwi,现在 wokwi 已经正式支持 Pi PICO,并且支持模拟 micropython 了。
https://wokwi.com/arduino/new?template= ... on-pi-pico
wokwi 支持在 Pi PICO 上模拟运行 micropython 了
- shaoziyang
- 帖子: 3966
- 注册时间: 2019年 10月 21日 13:48
Re: wokwi 支持在 Pi PICO 上模拟运行 micropython 了
一个小demo,在 wokwi 上用adc读取电位器。
在 main.py中输入下面代码:
在 diagram.json 中输入下面代码
在 main.py中输入下面代码:
Code: Select all
from machine import Pin, ADC
from time import sleep_ms
pot = ADC(Pin(28))
while 1:
print(pot.read_u16())
sleep_ms(500)
在 diagram.json 中输入下面代码
代码: 全选
{
"version": 1,
"author": "Anonymous maker",
"editor": "wokwi",
"parts": [
{
"type": "wokwi-pi-pico",
"id": "pico",
"top": 122.64,
"left": -141.89,
"attrs": { "env": "micropython-20210902-v1.17" }
},
{ "type": "wokwi-potentiometer", "id": "pot1", "top": 49.92, "left": 57.76, "attrs": {} }
],
"connections": [
[ "pot1:VCC", "pico:3V3", "red", [ "v0" ] ],
[ "pot1:GND", "pico:GND.8", "black", [ "v0" ] ],
[ "pot1:SIG", "pico:GP28", "green", [ "v0" ] ]
]
}
- shaoziyang
- 帖子: 3966
- 注册时间: 2019年 10月 21日 13:48
Re: wokwi 支持在 Pi PICO 上模拟运行 micropython 了
需要使用较新版本的 chrome 或 firefox 内核浏览器。
-
- 随机主题
- 回复总数
- 阅读次数
- 最新文章
-
- 1回复总数
- 604 阅读次数
- 最新文章 由 shaoziyang
2023年 7月 30日 10:35
-
- 8回复总数
- 605 阅读次数
- 最新文章 由 zhoukang8888
2023年 7月 31日 19:34
-
- 1回复总数
- 711 阅读次数
- 最新文章 由 shaoziyang
2023年 7月 31日 21:02