Install PlatformIO for Arduino, ESP8266, ESP32 and STM32

From JoBaPedia
Jump to navigation Jump to search

PlatformIO

Docs

Installation

Basically follow this guide: http://docs.platformio.org/en/latest/ide/atom.html#installation

  • Install and start Atom
sudo zypper in lsb-core-noarch clang
wget -O /dev/shm/atom.rpm https://atom.io/download/rpm
sudo rpm -ihv /dev/shm/atom.rpm
/usr/share/atom/resources/app/apm/bin/apm install platformio-ide
sudo ln -s ~/.platformio/penv/bin/platformio /usr/local/bin/platformio
sudo ln -s ~/.platformio/penv/bin/pio /usr/local/bin/pio
/usr/share/atom/atom

After installation is done and atom is (re)loaded

Convert from Arduino IDE

  • Projects are in $HOME/Documents/PlatformIO/Projects
  • Rename *.ino files to cpp (optional)
  • Add #include <Arduino.h> to main file
  • Make sure functions are declared before use (headers or prototypes)
  • Make private lib for project with more than one source file
  • If a lib is not found automatically via header scan, add it to lib_deps in platformio.ini of the project
  • Install lib, for example:
cd ~/Documents/PlatformIO/Projects/171116-211014-nodemcuv2
pio lib install 'Adafruit NeoPixel'