57 lines
3.5 KiB
TeX
57 lines
3.5 KiB
TeX
\section{PlatformIO}
|
|
|
|
There are several ways to compile and upload code to a micro-controller. The first tests where written and compiled in the Arduino IDE\footnote{\href{https://www.arduino.cc/en/software}{https://www.arduino.cc/en/software}}. Because references and cross-platform developing was not easy with this approach, developing in this project will be done with the help of PlatformIO.
|
|
|
|
``PlatformIO is a must-have tool for professional embedded systems engineers who develop solutions on more than one specific platform. In addition, by having a decentralized architecture, PlatformIO offers both new and existing developers a quick integration path for developing commercial-ready products, and reduces the overall time-to-market. [...] The build system structure automatically tags software dependencies and applies them using a modular hierarchy that takes away the usual complexity and pain. Developers no longer have to manually find and assemble an environment of tool-chains, compilers, and library dependencies to develop applications for a specific target. With PlatformIO, clicking the compile button will bring in all necessary dependencies automatically.''
|
|
|
|
\cite[cf.][]{pio-about}
|
|
|
|
\subsubsection{Install}
|
|
|
|
A dependency of PlatformIO is Python\footnote{\href{https://www.python.org/}{https://www.python.org/}}. To install the latest version of python, follow the installation instructions on their \href{https://www.python.org/}{website}.
|
|
|
|
PlatformIO can now simply installed by downloading a script called ``get-platformio.py'' and executing it. On Apple MacOS\footnote{\href{https://en.wikipedia.org/wiki/MacOS}{https://en.wikipedia.org/wiki/MacOS}} it can simply be installed with the help of Homebrew Packages Manager\footnote{\href{https://brew.sh/}{https://brew.sh/}}.
|
|
|
|
It is integrated into Visual Studio Code (Section \ref{sec:vsc}) and can be used with the official Plugin\footnote{\href{https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide}{https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide}} (Abbildung \ref{fig:PlatformIO in VSC}).
|
|
|
|
\subsubsection{Example configuration}
|
|
|
|
The configuration can be initialized with PIO Home or directly written into a \verb|plaftormio.ini| file. Following configuration can be used for simultaneous \verb|esp8266| and \verb|ESP32| usage:
|
|
|
|
\lstset{style=platform-io}
|
|
\begin{lstlisting}
|
|
[platformio]
|
|
default_envs = esp8266
|
|
|
|
[env:esp32]
|
|
platform = espressif32
|
|
board = az-delivery-devkit-v4
|
|
framework = arduino
|
|
monitor_speed = 115200
|
|
|
|
[env:esp8266]
|
|
platform = espressif8266
|
|
board = d1_mini
|
|
framework = arduino
|
|
monitor_speed = 115200
|
|
\end{lstlisting}
|
|
|
|
\subsection{IDE} \label{sec:vsc}
|
|
|
|
Developing and writing code for this project will be done in Visual Studio Code\footnote{\href{https://code.visualstudio.com/}{https://code.visualstudio.com/}}.
|
|
|
|
``Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C\#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).''
|
|
|
|
\cite[][]{vscode-about}
|
|
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\includegraphics[width=0.3\textwidth]{pio}
|
|
\caption{PlatformIO in VSC}
|
|
\label{fig:PlatformIO in VSC}
|
|
\end{center}
|
|
\end{figure}
|
|
|
|
\subsection{Documentation}
|
|
|
|
Documentation is written in \LaTeX and will be added to the library as source-code only.
|