Created
November 21, 2024 09:17
-
-
Save tanakamasayuki/2b8e879f7506c304529511a6e2f9b64d to your computer and use it in GitHub Desktop.
Windows環境でStampFlyのビルド環境を自動構築してビルドと転送をするバッチファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
IF EXIST "arduino-cli.exe" ( | |
ECHO arduino-cli find. | |
) ELSE ( | |
ECHO download arduino-cli | |
curl -L https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip -o arduino-cli_latest_Windows_64bit.zip | |
tar -xf arduino-cli_latest_Windows_64bit.zip | |
DEL arduino-cli_latest_Windows_64bit.zip | |
DEL LICENSE.txt | |
) | |
IF EXIST "StampFly-main\src\src.ino" ( | |
ECHO src ok | |
) ELSE ( | |
ECHO setup arduino-cli | |
arduino-cli core install esp32_2.0.17:esp32 --additional-urls https://tanakamasayuki.github.io/esp32-arduino-test/package_esp32_index_2_0_17.json | |
arduino-cli lib install FastLED | |
arduino-cli lib install INA3221 | |
ECHO download src | |
curl -L https://codeload.github.com/M5Fly-kanazawa/StampFly/zip/refs/heads/main -o StampFly.zip | |
tar -xf StampFly.zip | |
DEL StampFly.zip | |
copy /Y nul StampFly-main\src\src.ino | |
) | |
:compile | |
arduino-cli.exe compile StampFly-main/src/ --fqbn esp32_2.0.17:esp32:esp32s3 --libraries StampFly-main/lib/ -v | |
IF defined arduino_com ( | |
ECHO COM:%arduino_com% | |
) ELSE ( | |
arduino-cli board list | |
SET /P arduino_com=Please enter the connected COM number from the list above, such as COM3: | |
) | |
arduino-cli upload StampFly-main/src/ --fqbn esp32_2.0.17:esp32:esp32s3 -p %arduino_com% | |
ECHO( | |
ECHO When you are finished, press Ctrl+C or close the batch file. Pressing anything will build and transfer again. | |
ECHO( | |
PAUSE | |
GOTO compile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment