|
1 | | -# VSCode 最好用的 MicroPython 插件 |
| 1 | +# VSCode 最好用的 MicroPython 插件 |
| 2 | + |
| 3 | +## 介绍 ([English](#Introduction)) |
2 | 4 |
|
3 | 5 | VSCode 最好用的 MicroPython 插件,为 MicroPython 开发提供了强大的开发环境,主要特性如下: |
4 | 6 |
|
@@ -119,4 +121,105 @@ MicroPython 插件提供丰富的示例代码,可在左侧活动栏中查看 |
119 | 121 |
|
120 | 122 | - 不要删除工程目录下的 `.mpyproject.json` 文件,该文件是 MicroPython 工程的配置文件,删除后将无法正常运行 MicroPython 代码程序。 |
121 | 123 |
|
122 | | - |
| 124 | +--- |
| 125 | + |
| 126 | +# The best MicroPython plug-in of vscode |
| 127 | + |
| 128 | +## Introduction |
| 129 | + |
| 130 | +RT-Thread MicroPython is the best micropython plug-in in VScode, which provides a powerful development environment for MicroPython development. The main features are as follows: |
| 131 | + |
| 132 | +- Convenient connection mode of development board (serial port, network, USB) |
| 133 | +- Support MicroPython-based code intelligent completion and syntax check |
| 134 | +- Support MicroPython REPL interactive environment |
| 135 | +- Provides many code samples and demo program |
| 136 | +- Support full project synchronization function |
| 137 | +- Support for running sample code files on devices |
| 138 | +- Supports code snippets to run functions |
| 139 | +- Supports several major MicroPython development boards |
| 140 | +- Support Windows and ubuntu operating systems |
| 141 | + |
| 142 | +## Development board support list |
| 143 | + |
| 144 | +| number | Name of development board | Firmware acquisition | |
| 145 | +| ------ | ------------------------------------------------------------ | ------------------------------------------------------------ | |
| 146 | +| 1 | [潘多拉 IoT Board 物联网开发板 STM32L475](https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-18400369818.12.2ba47ea5PzJxZx&id=583843059625) | [RT-Thread 论坛固件汇总贴](https://www.rt-thread.org/qa/forum.php?mod=viewthread&tid=12305&page=1&extra=#pid52954) | |
| 147 | +| 2 | [正点原子 W601 WIFI 物联网开发板](https://item.taobao.com/item.htm?spm=a230r.1.14.13.7c5b4a9bS2LYUD&id=602233847745&ns=1&abbucket=17#detail) | [RT-Thread 论坛固件汇总贴](https://www.rt-thread.org/qa/forum.php?mod=viewthread&tid=12305&page=1&extra=#pid52954) | |
| 148 | +| 3 | [正点原子探索者 STM32F407 开发板](https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-18400369818.18.569779dc0A3gkT&id=41855882779) | [RT-Thread 论坛固件汇总贴](https://www.rt-thread.org/qa/forum.php?mod=viewthread&tid=12305&page=1&extra=#pid52954) | |
| 149 | +| 4 | [ESP8266](http://docs.micropython.org/en/latest/esp8266/quickref.html) | [Official download link](https://micropython.org/download#esp8266) | |
| 150 | +| 5 | [ESP32](http://docs.micropython.org/en/latest/esp32/quickref.html) | [Official download link](https://micropython.org/download#esp32) | |
| 151 | +| 6 | [PYboard](http://docs.micropython.org/en/latest/pyboard/quickref.html) | [Official download link](https://micropython.org/download#pyboard) | |
| 152 | +| 7 | [others](https://micropython.org/download#other) | [Official download link](https://micropython.org/download#other) | |
| 153 | + |
| 154 | +The firmware for the development boards numbered 1, 2, and 3 is provided by rt-thread, and is also optimized for the MicroPython plug-in development environment to provide powerful engineering synchronization and richer firmware features. |
| 155 | + |
| 156 | +## Preparation |
| 157 | + |
| 158 | +1. Using plug-in under the Windows operating system requires changing the default terminal of vscode to powershell, as shown below: |
| 159 | + |
| 160 | +  |
| 161 | + |
| 162 | +If you want to use the MicroPython autocompletion feature (you can skip the next step if you don't need autocompletion for now), you need to do the following: |
| 163 | + |
| 164 | +2. Install the Python plug-in |
| 165 | + |
| 166 | +3. Install Python3 on your PC and add it to the system environment variables as instructed by the Python plug-in |
| 167 | + |
| 168 | +  |
| 169 | + |
| 170 | +If you already have the above plug-ins and programs installed on your PC, you can skip this preparation step. |
| 171 | + |
| 172 | +### Ubuntu support |
| 173 | + |
| 174 | +This plug-in supports running under **ubuntu 18.04**. In order to avoid frequent access to serial port permissions under ubuntu system, the current user needs to be added to the user group `dialout`. Manually enter the following command: `$USERNAME` is the current USERNAME of the system: |
| 175 | + |
| 176 | +`sudo usermod -ag dialout $USERNAME` |
| 177 | + |
| 178 | +Note: the configuration change requires **to restart the operating system** for the configuration to take effect. |
| 179 | + |
| 180 | +## Quick Start |
| 181 | + |
| 182 | +### Create a MicroPython project |
| 183 | + |
| 184 | +The first step in MicroPython development is to create a MicroPython project within which all subsequent operations must run. There are two ways to create a new MicroPython project, a blank project and a demo-based project, which are shown below. |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | +### Connecting development board |
| 189 | + |
| 190 | +You can connect to the MicroPython development board by clicking the connection button in the lower left corner and then selecting the device you want to connect to in the pop-up list of devices. |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | +### View the sample code file |
| 195 | + |
| 196 | +The MicroPython plug-in provides a wealth of sample code and library files to view in the left active bar. |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | +### Run the MicroPython file on the device |
| 201 | + |
| 202 | +After successful connection of the development board, right click on the sample code file, select 'download and run the MicroPython file' on the device from the menu, and the sample file can be downloaded to the development board and run, as shown below: |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | +### Run MicroPython code snippets on the development board |
| 207 | + |
| 208 | +If you just want to debug a small amount of code without downloading files to the development board, you can use the **code snippet** function.You can run the selected code in the REPL environment by selecting the snippet you want to run in the editor, and then selecting the 'execute the selected MicroPython code' option on the device from the right-click menu. |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | +### Intelligent code completion based on MicroPython |
| 213 | + |
| 214 | +This plug-in supports intelligent code completion and syntax checking based on MicroPython syntax, which is a powerful tool for developing MicroPython code.It allows developers to write functions while looking at API parameter hints, and it gives them a visual reminder that makes it easier to find errors in code. |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | +## Matters needing attention |
| 219 | + |
| 220 | +- Do not delete the `.mpyproject.json` file in the project directory. This file is the configuration file of the MicroPython project. |
| 221 | + |
| 222 | +## Contact & Supports |
| 223 | + |
| 224 | +- [Github](https://github.com/SummerGGift/ampy) |
| 225 | +- Support Email : [email protected] |
0 commit comments