This is a port of Arduino Blink example to platformio.
portenta_h7_m7, teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32, nanorp2040connect, pico.
Install essential build tools. Remove brltty package which interferes with CH340 USB serial on some esp32 boards.
sudo apt remove brltty -y
sudo apt install python3-venv build-essential cmake git curl -y
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
python3 get-platformio.py
echo "PATH="$PATH:$HOME/.platformio/penv/bin"" >> ~/.bashrc
source ~/.bashrc
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
sudo service udev restart
sudo usermod -a -G dialout $USER
sudo usermod -a -G plugdev $USER
git clone https://github.com/hippo5329/Blink-platformio.git
Build and upload to esp32 devkit. The on-board LED should blink every two seconds.
cd Blink-platformio
pio run -e esp32 -t upload
You may find more examples from Arduino. You may try to port them to platformio the way I do.
- Create a src subdirectory. Move the .ino source into src subdirectory.
- Copy my platformio.ini. And, optionally, .gitignore.
- Build, upload and test.