Write your code
When you have a project, either created from scratch or imported from a sample, you can add as many Python/MicroPython or other files as you want. All the files and directories created in the project are uploaded to the Digi device.
Note By default, when building:
- MicroPython files are compiled.
- Python files are not compiled.
Compiled files are smaller, and allows to optimize space in the device file system.
You can enable/disable the source compilation from the project preferences.
See Enable/disable Python/MicroPython sources compilation.
To create new files or directories, right-click the project view and select New > MicroPython File or New > Directory.
In addition, the Digi XBee PyCharm IDE Plugin offers you some features and help while you are writing your code in the PyCharm editor:
- Code completion. As you write the code, the plugin auto-completes and suggests method, constant, and class names available in the Digi Python/MicroPython ecosystem.
- Quick documentation. The plugin displays a quick documentation popup when you use any method or class, describing its signature, parameters, and return values.
Note The quick documentation popup is disabled by default in the IDE. To enable see Show the quick documentation popup.
- Syntax and error highlight. As with other languages, Python/MicroPython keywords are highlighted as well as any error in the code, explaining the error and how to fix it.