At first, you need a tool to deal with your code. You could install the MadMachine extension for Visual Studio Code. It allows you to create a new project, compile and download it to your board.
Install the extension
- In the Visual Studio Code, click the Extension icon on the left activity bar.
- Enter MadMachine in the search box to find the extension in its marketplace.
- Click the Install button.
When you install the MadMachine extension, the extension Serial Port Helper will be installed as well. It allows you to view values or debug. Of course, you could use other similar tools instead.
For advanced users, you could edit your code wherever you like and use the mm-sdk to compile your code.
Set the extension
The extension relies on the mm sdk to do all its work. So you need to indicate its path before using the extension. You only set it the first time you use this extension.
Download the latest sdk release according to your operating system and unzip it. The versions marked as pre-relase are for internal test and may be unavailable.
Then come back to the VS code. In the menu bar, select Code / Preferences / Settings.
- In the Settings, select Extensions / MadMachine. Enter the path of the sdk in the box that matches your operating system. Windows is not supported since we are waiting for the Window support of Swift language...
Now, the extension gets ready👏.
The extension is at the bottom of the Explore panel. All you need for your project is these three buttons:
- Build: build your project after you finish the code. If there are any errors, you can modify your code according to the message in the terminal.
- Download: download the bin file generated after building your project.
- New Project: create a new MadMachine project. You will decide the project type and the board type.