commit c333bb678ce479b031c33e206214a66aa9ac847e Author: rafa Date: Sat May 10 23:23:47 2025 +0100 Update project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9a756c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +build/ + + diff --git a/.vscode/run b/.vscode/run new file mode 100755 index 0000000..8cc30ec --- /dev/null +++ b/.vscode/run @@ -0,0 +1,13 @@ + +#!/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 + diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f8a04f1 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,18 @@ + +{ + // 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 + } + } + ] +} + diff --git a/bin/arduino-cli b/bin/arduino-cli new file mode 100755 index 0000000..e43d830 Binary files /dev/null and b/bin/arduino-cli differ diff --git a/code/code.ino b/code/code.ino new file mode 100644 index 0000000..74f966a --- /dev/null +++ b/code/code.ino @@ -0,0 +1,6 @@ + +void setup() { +} + +void loop() { +} diff --git a/diagram.json b/diagram.json new file mode 100644 index 0000000..874e505 --- /dev/null +++ b/diagram.json @@ -0,0 +1,10 @@ + +{ + "version": 1, + "author": "Anonymous maker", + "editor": "wokwi", + "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": -28.2, "left": -10.2, "attrs": {} } ], + "connections": [], + "dependencies": {} +} + diff --git a/install-windows.bat b/install-windows.bat new file mode 100644 index 0000000..b4e879b --- /dev/null +++ b/install-windows.bat @@ -0,0 +1,68 @@ +@echo off +REM === Configuração Arduino + VSCode + Wokwi (Windows) === +REM === Usa PowerShell para automação no run.bat === + +mkdir .vscode 2>nul +mkdir bin 2>nul +mkdir libs 2>nul + +REM --- Baixa e instala arduino-cli --- +cd bin +curl -L -o arduino-cli.zip https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip +tar -xf arduino-cli.zip +del arduino-cli.zip +del LICENSE.txt +cd .. + +REM --- Cria run.bat com automação via PowerShell --- +echo @echo off > .vscode\run.bat +echo echo Compiling... >> .vscode\run.bat +echo .\bin\arduino-cli.exe compile --fqbn arduino:avr:uno code --libraries .\libraries\ --build-path .\build --clean >> .vscode\run.bat +echo. >> .vscode\run.bat +echo powershell -Command "Add-Type -AssemblyName System.Windows.Forms; Start-Sleep -Milliseconds 300; [Windows.Forms.SendKeys]::SendWait('^+p'); Start-Sleep -Milliseconds 500; [Windows.Forms.SendKeys]::SendWait('Wokwi: Start Simulation{ENTER}')" >> .vscode\run.bat + +REM --- tasks.json --- +echo { > .vscode\tasks.json +echo "version": "2.0.0", >> .vscode\tasks.json +echo "tasks": [ >> .vscode\tasks.json +echo { >> .vscode\tasks.json +echo "label": "Run", >> .vscode\tasks.json +echo "type": "shell", >> .vscode\tasks.json +echo "command": "${workspaceFolder}\\.vscode\\run.bat", >> .vscode\tasks.json +echo "group": { >> .vscode\tasks.json +echo "kind": "build", >> .vscode\tasks.json +echo "isDefault": true >> .vscode\tasks.json +echo } >> .vscode\tasks.json +echo } >> .vscode\tasks.json +echo ] >> .vscode\tasks.json +echo } >> .vscode\tasks.json + +REM --- Outros arquivos --- +echo build/ > .gitignore + +echo { > diagram.json +echo "version": 1, >> diagram.json +echo "author": "Anonymous maker", >> diagram.json +echo "editor": "wokwi", >> diagram.json +echo "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": -28.2, "left": -10.2, "attrs": {} } ], >> diagram.json +echo "connections": [], >> diagram.json +echo "dependencies": {} >> diagram.json +echo } >> diagram.json + +echo [wokwi] > wokwi.toml +echo version = 1 >> wokwi.toml +echo firmware = "build/code.ino.hex" >> wokwi.toml +echo elf = "build/code.ino.elf" >> wokwi.toml + +REM --- Instalação do core AVR --- +bin\arduino-cli.exe core install arduino:avr +bin\arduino-cli.exe sketch new code + +REM --- Limpeza --- +del README.md 2>nul +rmdir /s /q .git 2>nul + +echo. +del install-linux.sh 2>nul +del install-windows.bat 2>nul +pause \ No newline at end of file diff --git a/wokwi.toml b/wokwi.toml new file mode 100644 index 0000000..f2e4048 --- /dev/null +++ b/wokwi.toml @@ -0,0 +1,6 @@ + +[wokwi] +version = 1 +firmware = 'build/code.ino.hex' +elf = 'build/code.ino.elf' +