-
Notifications
You must be signed in to change notification settings - Fork 842
2.3 Adding a platform to Code view
Since version 0.9.1b, Fritzing has another view called the Code View. This allows users to write microcontroller code inside of Fritzing and also compile and upload it from there.
In order for this to work, supported platforms must offer a command-line compilation & upload tool. This needs to be downloaded separately by the user and configured in Fritzing (under Preferences > Code View). Fritzing provides several guides to make this obvious for users.
Coding support for a platform comprises the following features:
- Syntax highlighting
- Automatic file extension
- Board selection
- Code compilation & upload
- Serial monitor
Currently, code view supports the following platforms:
- Arduino, through the Arduino IDE CLI
- PICAXE, through the PICAXE Compilers
To enable all of these features, we need to make the relevant information available through the following files. We're using Arduino here as an example:
Add this class for the supported platform. This is where all parameters specific to the platform are configured and the upload process is managed. Just copy and paste the Arduino or PICAXE example and adapt it to your platform.
Make sure you also include these classes in /pri/program.pri
.
Once you have created the platform class, simply add it to the initialisation in ProgramWindow::initPlatforms()
m_platforms << new PlatformArduino() << new PlatformPicaxe();
This file contains the syntax description for the platform in Kate format. There are many of these available already for all kinds of languages. Try googling before you start creating a new one.
COPYRIGHT FRITZING.ORG ALL RIGHTS RESERVED