85 lines
1.6 KiB
Bash
Executable File
85 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Create dirs
|
|
|
|
mkdir .vscode bin libs
|
|
|
|
# create files
|
|
|
|
echo "
|
|
#!/bin/bash
|
|
|
|
./bin/arduino-cli compile --fqbn arduino:avr:uno code --libraries ./libraries/ --build-path ./build --clean
|
|
|
|
echo \"Starting simulation...\"
|
|
|
|
sleep 1
|
|
|
|
xdotool key ctrl+shift+p
|
|
xdotool type \"Wokwi: Start Simulation\"
|
|
xdotool key Return
|
|
" >> .vscode/run
|
|
|
|
chmod +x .vscode/run
|
|
|
|
echo "
|
|
{
|
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
// for the documentation about the tasks.json format
|
|
\"version\": \"2.0.0\",
|
|
\"tasks\": [
|
|
{
|
|
\"label\": \"Run\",
|
|
\"type\": \"shell\",
|
|
\"command\": \"\${workspaceFolder}/.vscode/run\",
|
|
\"group\": {
|
|
\"kind\": \"build\",
|
|
\"isDefault\": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
" >> .vscode/tasks.json
|
|
|
|
echo "
|
|
build/
|
|
|
|
" >> .gitignore
|
|
|
|
echo "
|
|
{
|
|
\"version\": 1,
|
|
\"author\": \"Anonymous maker\",
|
|
\"editor\": \"wokwi\",
|
|
\"parts\": [ { \"type\": \"wokwi-arduino-uno\", \"id\": \"uno\", \"top\": -28.2, \"left\": -10.2, \"attrs\": {} } ],
|
|
\"connections\": [],
|
|
\"dependencies\": {}
|
|
}
|
|
" >> diagram.json
|
|
|
|
echo "
|
|
[wokwi]
|
|
version = 1
|
|
firmware = 'build/code.ino.hex'
|
|
elf = 'build/code.ino.elf'
|
|
" >> wokwi.toml
|
|
|
|
# get arduino-cli
|
|
|
|
cd bin
|
|
wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz
|
|
tar xvf arduino-cli_latest_Linux_64bit.tar.gz
|
|
rm arduino-cli_latest_Linux_64bit.tar.gz
|
|
rm LICENSE.txt
|
|
|
|
./arduino-cli core install arduino:avr
|
|
|
|
cd ..
|
|
|
|
./bin/arduino-cli sketch new code
|
|
|
|
|
|
rm -rf README.md
|
|
rm -rf .git/
|
|
rm -rf install-windows.bat
|
|
rm -rf install-linux.sh |