├── blink_a ├── .gitignore ├── 4_BDL_RGB.jpg ├── 2_BDL_Pico.jpg ├── 3_BDL_Frente.jpg ├── 5_SMD5050_RGB.jpg ├── 1_BitDogLab_RGB.jpg ├── .vscode │ ├── extensions.json │ ├── cmake-kits.json │ ├── c_cpp_properties.json │ ├── tasks.json │ ├── settings.json │ └── launch.json ├── blink.c ├── CMakeLists.txt └── pico_sdk_import.cmake ├── LedRGBWokwi ├── .gitignore ├── 2_BDL_Pico.jpg ├── 4_BDL_RGB.jpg ├── wokwi.toml ├── 3_BDL_Frente.jpg ├── 5_SMD5050_RGB.jpg ├── 1_BitDogLab_RGB.jpg ├── 6_WokwiLedTricolor.png ├── .vscode │ ├── extensions.json │ ├── cmake-kits.json │ ├── c_cpp_properties.json │ ├── settings.json │ ├── tasks.json │ └── launch.json ├── diagram.json ├── LedTricolor.c ├── CMakeLists.txt └── pico_sdk_import.cmake ├── blink_print ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── cmake-kits.json │ ├── c_cpp_properties.json │ ├── tasks.json │ ├── settings.json │ └── launch.json ├── blink.c ├── CMakeLists.txt └── pico_sdk_import.cmake ├── blink_a_ComWokwi ├── .gitignore ├── wokwi.toml ├── 2_BDL_Pico.jpg ├── 4_BDL_RGB.jpg ├── 6_WokwiLed.png ├── 3_BDL_Frente.jpg ├── 5_SMD5050_RGB.jpg ├── 1_BitDogLab_RGB.jpg ├── .vscode │ ├── extensions.json │ ├── cmake-kits.json │ ├── c_cpp_properties.json │ ├── tasks.json │ ├── settings.json │ └── launch.json ├── diagram.json ├── blink.c ├── CMakeLists.txt └── pico_sdk_import.cmake ├── blink_print_ComWokwi ├── .gitignore ├── wokwi.toml ├── .vscode │ ├── extensions.json │ ├── cmake-kits.json │ ├── c_cpp_properties.json │ ├── tasks.json │ ├── settings.json │ └── launch.json ├── blink.c ├── diagram.json ├── CMakeLists.txt └── pico_sdk_import.cmake ├── ArquivosUF2 ├── 01-blink.uf2 ├── 02-BotaoA.uf2 ├── 06-Buzzer.uf2 ├── 01-blinkRGB.uf2 ├── 02-Botoes_A_B.uf2 ├── 04-adcA0Print.uf2 ├── 05-microfone.uf2 ├── 07-Diversos.uf2 ├── 01-BlinkWS2812.uf2 ├── 03-DisplayBotJoy.uf2 ├── 03-DisplayEmbarcaTech.uf2 └── DeFabrica │ ├── BitDogLab_W.uf2 │ └── BitDogLab_Original.py ├── keyboard-shortcuts-windows.pdf └── Mblink_a_vscode_sdk ├── blink.c └── CMakeLists.txt /blink_a/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /LedRGBWokwi/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /blink_print/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /blink_a/4_BDL_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a/4_BDL_RGB.jpg -------------------------------------------------------------------------------- /ArquivosUF2/01-blink.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/01-blink.uf2 -------------------------------------------------------------------------------- /blink_a/2_BDL_Pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a/2_BDL_Pico.jpg -------------------------------------------------------------------------------- /blink_a/3_BDL_Frente.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a/3_BDL_Frente.jpg -------------------------------------------------------------------------------- /ArquivosUF2/02-BotaoA.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/02-BotaoA.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/06-Buzzer.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/06-Buzzer.uf2 -------------------------------------------------------------------------------- /LedRGBWokwi/2_BDL_Pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/2_BDL_Pico.jpg -------------------------------------------------------------------------------- /LedRGBWokwi/4_BDL_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/4_BDL_RGB.jpg -------------------------------------------------------------------------------- /LedRGBWokwi/wokwi.toml: -------------------------------------------------------------------------------- 1 | [wokwi] 2 | version = 1 3 | firmware = 'build/LedTricolor.uf2' 4 | elf = 'build/LedTricolor.elf' -------------------------------------------------------------------------------- /blink_a/5_SMD5050_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a/5_SMD5050_RGB.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/wokwi.toml: -------------------------------------------------------------------------------- 1 | [wokwi] 2 | version = 1 3 | firmware = 'build/blink.uf2' 4 | elf = 'build/blink.elf' 5 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/wokwi.toml: -------------------------------------------------------------------------------- 1 | [wokwi] 2 | version = 1 3 | firmware = 'build/blink.uf2' 4 | elf = 'build/blink.elf' -------------------------------------------------------------------------------- /ArquivosUF2/01-blinkRGB.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/01-blinkRGB.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/02-Botoes_A_B.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/02-Botoes_A_B.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/04-adcA0Print.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/04-adcA0Print.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/05-microfone.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/05-microfone.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/07-Diversos.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/07-Diversos.uf2 -------------------------------------------------------------------------------- /LedRGBWokwi/3_BDL_Frente.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/3_BDL_Frente.jpg -------------------------------------------------------------------------------- /LedRGBWokwi/5_SMD5050_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/5_SMD5050_RGB.jpg -------------------------------------------------------------------------------- /blink_a/1_BitDogLab_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a/1_BitDogLab_RGB.jpg -------------------------------------------------------------------------------- /ArquivosUF2/01-BlinkWS2812.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/01-BlinkWS2812.uf2 -------------------------------------------------------------------------------- /LedRGBWokwi/1_BitDogLab_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/1_BitDogLab_RGB.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/2_BDL_Pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/2_BDL_Pico.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/4_BDL_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/4_BDL_RGB.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/6_WokwiLed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/6_WokwiLed.png -------------------------------------------------------------------------------- /keyboard-shortcuts-windows.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/keyboard-shortcuts-windows.pdf -------------------------------------------------------------------------------- /ArquivosUF2/03-DisplayBotJoy.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/03-DisplayBotJoy.uf2 -------------------------------------------------------------------------------- /LedRGBWokwi/6_WokwiLedTricolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/LedRGBWokwi/6_WokwiLedTricolor.png -------------------------------------------------------------------------------- /blink_a_ComWokwi/3_BDL_Frente.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/3_BDL_Frente.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/5_SMD5050_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/5_SMD5050_RGB.jpg -------------------------------------------------------------------------------- /blink_a_ComWokwi/1_BitDogLab_RGB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/blink_a_ComWokwi/1_BitDogLab_RGB.jpg -------------------------------------------------------------------------------- /ArquivosUF2/03-DisplayEmbarcaTech.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/03-DisplayEmbarcaTech.uf2 -------------------------------------------------------------------------------- /ArquivosUF2/DeFabrica/BitDogLab_W.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiltonlacerda/EmbarcaTechU4C1/HEAD/ArquivosUF2/DeFabrica/BitDogLab_W.uf2 -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "marus25.cortex-debug", 4 | "ms-vscode.cpptools", 5 | "ms-vscode.cpptools-extension-pack", 6 | "ms-vscode.vscode-serial-monitor", 7 | "raspberry-pi.raspberry-pi-pico", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /blink_a/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "marus25.cortex-debug", 4 | "ms-vscode.cpptools", 5 | "ms-vscode.cpptools-extension-pack", 6 | "ms-vscode.vscode-serial-monitor", 7 | "raspberry-pi.raspberry-pi-pico", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /blink_print/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "marus25.cortex-debug", 4 | "ms-vscode.cpptools", 5 | "ms-vscode.cpptools-extension-pack", 6 | "ms-vscode.vscode-serial-monitor", 7 | "raspberry-pi.raspberry-pi-pico", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "marus25.cortex-debug", 4 | "ms-vscode.cpptools", 5 | "ms-vscode.cpptools-extension-pack", 6 | "ms-vscode.vscode-serial-monitor", 7 | "raspberry-pi.raspberry-pi-pico", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "marus25.cortex-debug", 4 | "ms-vscode.cpptools", 5 | "ms-vscode.cpptools-extension-pack", 6 | "ms-vscode.vscode-serial-monitor", 7 | "raspberry-pi.raspberry-pi-pico", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /blink_a/blink.c: -------------------------------------------------------------------------------- 1 | #include "pico/stdlib.h" 2 | 3 | #define led_pin_red 13 4 | 5 | int main() { 6 | gpio_init(led_pin_red); 7 | gpio_set_dir(led_pin_red, GPIO_OUT); 8 | 9 | while (true) { 10 | gpio_put(led_pin_red, true); 11 | sleep_ms(1000); 12 | gpio_put(led_pin_red, false); 13 | sleep_ms(1000); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mblink_a_vscode_sdk/blink.c: -------------------------------------------------------------------------------- 1 | #include "pico/stdlib.h" 2 | 3 | #define led_pin_red 13 4 | 5 | int main() { 6 | gpio_init(led_pin_red); 7 | gpio_set_dir(led_pin_red, GPIO_OUT); 8 | 9 | while (true) { 10 | gpio_put(led_pin_red, true); 11 | sleep_ms(70); 12 | gpio_put(led_pin_red, false); 13 | sleep_ms(70); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/cmake-kits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Pico", 4 | "compilers": { 5 | "C": "${command:raspberry-pi-pico.getCompilerPath}", 6 | "CXX": "${command:raspberry-pi-pico.getCxxCompilerPath}" 7 | }, 8 | "environmentVariables": { 9 | "PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" 10 | }, 11 | "cmakeSettings": { 12 | "Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" 13 | } 14 | } 15 | ] -------------------------------------------------------------------------------- /blink_a/.vscode/cmake-kits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Pico", 4 | "compilers": { 5 | "C": "${command:raspberry-pi-pico.getCompilerPath}", 6 | "CXX": "${command:raspberry-pi-pico.getCxxCompilerPath}" 7 | }, 8 | "environmentVariables": { 9 | "PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" 10 | }, 11 | "cmakeSettings": { 12 | "Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" 13 | } 14 | } 15 | ] -------------------------------------------------------------------------------- /blink_print/.vscode/cmake-kits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Pico", 4 | "compilers": { 5 | "C": "${command:raspberry-pi-pico.getCompilerPath}", 6 | "CXX": "${command:raspberry-pi-pico.getCxxCompilerPath}" 7 | }, 8 | "environmentVariables": { 9 | "PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" 10 | }, 11 | "cmakeSettings": { 12 | "Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" 13 | } 14 | } 15 | ] -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/cmake-kits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Pico", 4 | "compilers": { 5 | "C": "${command:raspberry-pi-pico.getCompilerPath}", 6 | "CXX": "${command:raspberry-pi-pico.getCxxCompilerPath}" 7 | }, 8 | "environmentVariables": { 9 | "PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" 10 | }, 11 | "cmakeSettings": { 12 | "Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" 13 | } 14 | } 15 | ] -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/cmake-kits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Pico", 4 | "compilers": { 5 | "C": "${command:raspberry-pi-pico.getCompilerPath}", 6 | "CXX": "${command:raspberry-pi-pico.getCxxCompilerPath}" 7 | }, 8 | "environmentVariables": { 9 | "PATH": "${command:raspberry-pi-pico.getEnvPath};${env:PATH}" 10 | }, 11 | "cmakeSettings": { 12 | "Python3_EXECUTABLE": "${command:raspberry-pi-pico.getPythonPath}" 13 | } 14 | } 15 | ] -------------------------------------------------------------------------------- /blink_print_ComWokwi/blink.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "pico/stdlib.h" 3 | 4 | const uint led_pin_red = 13; 5 | #define tempo 500 6 | uint a = 0; 7 | 8 | int main() 9 | { 10 | 11 | gpio_init(led_pin_red); 12 | gpio_set_dir(led_pin_red, GPIO_OUT); 13 | stdio_init_all(); 14 | 15 | while (true) 16 | { 17 | if (a % 2) 18 | printf("Blinking! %d\r\n", a); 19 | a++; 20 | gpio_put(led_pin_red, true); 21 | printf("Led Ligado.. "); 22 | sleep_ms(tempo); 23 | gpio_put(led_pin_red, false); 24 | printf("Led desligado..\r\n"); 25 | sleep_ms(tempo); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /blink_print/blink.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "pico/stdlib.h" 4 | 5 | const uint led_pin_red = 13; 6 | #define tempo 50 7 | 8 | int main() { 9 | uint a = 100; 10 | 11 | gpio_init(led_pin_red); 12 | gpio_set_dir(led_pin_red, GPIO_OUT); 13 | stdio_init_all(); 14 | 15 | while (true) { 16 | if (a % 2) 17 | printf("Blinking!\r\n"); 18 | 19 | gpio_put(led_pin_red, true); 20 | printf("Led Ligado.. "); 21 | sleep_ms(tempo); 22 | gpio_put(led_pin_red, false); 23 | printf("Led desligado..\r\n"); 24 | sleep_ms(tempo); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /blink_a/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Pico", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${userHome}/.pico-sdk/sdk/2.0.0/**" 8 | ], 9 | "forcedInclude": [ 10 | "${userHome}/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include/pico.h", 11 | "${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" 12 | ], 13 | "defines": [], 14 | "compilerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", 15 | "compileCommands": "${workspaceFolder}/build/compile_commands.json", 16 | "cStandard": "c17", 17 | "cppStandard": "c++14", 18 | "intelliSenseMode": "linux-gcc-arm" 19 | } 20 | ], 21 | "version": 4 22 | } 23 | -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Pico", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${userHome}/.pico-sdk/sdk/2.0.0/**" 8 | ], 9 | "forcedInclude": [ 10 | "${userHome}/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include/pico.h", 11 | "${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" 12 | ], 13 | "defines": [], 14 | "compilerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", 15 | "compileCommands": "${workspaceFolder}/build/compile_commands.json", 16 | "cStandard": "c17", 17 | "cppStandard": "c++14", 18 | "intelliSenseMode": "linux-gcc-arm" 19 | } 20 | ], 21 | "version": 4 22 | } 23 | -------------------------------------------------------------------------------- /blink_print/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Pico", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${userHome}/.pico-sdk/sdk/2.0.0/**" 8 | ], 9 | "forcedInclude": [ 10 | "${userHome}/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include/pico.h", 11 | "${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" 12 | ], 13 | "defines": [], 14 | "compilerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", 15 | "compileCommands": "${workspaceFolder}/build/compile_commands.json", 16 | "cStandard": "c17", 17 | "cppStandard": "c++14", 18 | "intelliSenseMode": "linux-gcc-arm" 19 | } 20 | ], 21 | "version": 4 22 | } 23 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Pico", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${userHome}/.pico-sdk/sdk/2.0.0/**" 8 | ], 9 | "forcedInclude": [ 10 | "${userHome}/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include/pico.h", 11 | "${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" 12 | ], 13 | "defines": [], 14 | "compilerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", 15 | "compileCommands": "${workspaceFolder}/build/compile_commands.json", 16 | "cStandard": "c17", 17 | "cppStandard": "c++14", 18 | "intelliSenseMode": "linux-gcc-arm" 19 | } 20 | ], 21 | "version": 4 22 | } 23 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Pico", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${userHome}/.pico-sdk/sdk/2.0.0/**" 8 | ], 9 | "forcedInclude": [ 10 | "${userHome}/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include/pico.h", 11 | "${workspaceFolder}/build/generated/pico_base/pico/config_autogen.h" 12 | ], 13 | "defines": [], 14 | "compilerPath": "${userHome}/.pico-sdk/toolchain/13_2_Rel1/bin/arm-none-eabi-gcc.exe", 15 | "compileCommands": "${workspaceFolder}/build/compile_commands.json", 16 | "cStandard": "c17", 17 | "cppStandard": "c++14", 18 | "intelliSenseMode": "linux-gcc-arm" 19 | } 20 | ], 21 | "version": 4 22 | } 23 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/diagram.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "author": "Wilton L. Silva", 4 | "editor": "wokwi", 5 | "parts": [ 6 | { 7 | "type": "board-pi-pico-w", 8 | "id": "pico", 9 | "top": -70.45, 10 | "left": -6.05, 11 | "attrs": { "builder": "pico-sdk" } 12 | }, 13 | { 14 | "type": "wokwi-led", 15 | "id": "led1", 16 | "top": -61.2, 17 | "left": -101.8, 18 | "attrs": { "color": "red" } 19 | }, 20 | { 21 | "type": "wokwi-resistor", 22 | "id": "r1", 23 | "top": 33.6, 24 | "left": -115.75, 25 | "rotate": 90, 26 | "attrs": { "value": "1000" } 27 | } 28 | ], 29 | "connections": [ 30 | [ "pico:GP0", "$serialMonitor:RX", "", [] ], 31 | [ "pico:GP1", "$serialMonitor:TX", "", [] ], 32 | [ "led1:C", "r1:1", "gray", [ "v0" ] ], 33 | [ "pico:GND.4", "r1:2", "black", [ "h0" ] ], 34 | [ "pico:GP13", "led1:A", "green", [ "h0" ] ] 35 | ], 36 | "dependencies": {} 37 | } 38 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/diagram.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "author": "Wilton L. Silva", 4 | "editor": "wokwi", 5 | "parts": [ 6 | { 7 | "type": "board-pi-pico-w", 8 | "id": "pico", 9 | "top": -70.45, 10 | "left": -6.05, 11 | "attrs": { "builder": "pico-sdk" } 12 | }, 13 | { 14 | "type": "wokwi-led", 15 | "id": "led1", 16 | "top": -61.2, 17 | "left": -101.8, 18 | "attrs": { "color": "red" } 19 | }, 20 | { 21 | "type": "wokwi-resistor", 22 | "id": "r1", 23 | "top": 33.6, 24 | "left": -115.75, 25 | "rotate": 90, 26 | "attrs": { "value": "1000" } 27 | } 28 | ], 29 | "connections": [ 30 | [ "pico:GP0", "$serialMonitor:RX", "", [] ], 31 | [ "pico:GP1", "$serialMonitor:TX", "", [] ], 32 | [ "led1:C", "r1:1", "gray", [ "v0" ] ], 33 | [ "pico:GND.4", "r1:2", "black", [ "h0" ] ], 34 | [ "pico:GP13", "led1:A", "green", [ "h0" ] ] 35 | ], 36 | "dependencies": {} 37 | } -------------------------------------------------------------------------------- /LedRGBWokwi/diagram.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "author": "Wilton L. Silva", 4 | "editor": "wokwi", 5 | "parts": [ 6 | { 7 | "type": "board-pi-pico-w", 8 | "id": "pico", 9 | "top": -70.45, 10 | "left": -6.05, 11 | "attrs": { "builder": "pico-sdk" } 12 | }, 13 | { 14 | "type": "wokwi-resistor", 15 | "id": "r1", 16 | "top": 119.15, 17 | "left": -96, 18 | "attrs": { "value": "1000" } 19 | }, 20 | { 21 | "type": "wokwi-rgb-led", 22 | "id": "rgb1", 23 | "top": 47, 24 | "left": -162.9, 25 | "rotate": 270, 26 | "attrs": { "common": "cathode" } 27 | } 28 | ], 29 | "connections": [ 30 | [ "pico:GP0", "$serialMonitor:RX", "", [] ], 31 | [ "pico:GP1", "$serialMonitor:TX", "", [] ], 32 | [ "pico:GND.4", "r1:2", "black", [ "h0" ] ], 33 | [ "r1:1", "rgb1:COM", "#8f4814", [ "v0" ] ], 34 | [ "rgb1:R", "pico:GP13", "red", [ "v0" ] ], 35 | [ "rgb1:G", "pico:GP11", "green", [ "v0" ] ], 36 | [ "rgb1:B", "pico:GP12", "blue", [ "h67.2", "v-1.6" ] ] 37 | ], 38 | "dependencies": {} 39 | } -------------------------------------------------------------------------------- /blink_a/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated Cmake Pico project file 2 | 3 | cmake_minimum_required(VERSION 3.13) 4 | 5 | set(CMAKE_C_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 8 | 9 | # Initialise pico_sdk from installed location 10 | # (note this can come from environment, CMake cache etc) 11 | 12 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 13 | if(WIN32) 14 | set(USERHOME $ENV{USERPROFILE}) 15 | else() 16 | set(USERHOME $ENV{HOME}) 17 | endif() 18 | set(sdkVersion 2.1.0) 19 | set(toolchainVersion 13_3_Rel1) 20 | set(picotoolVersion 2.1.0) 21 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 22 | if (EXISTS ${picoVscode}) 23 | include(${picoVscode}) 24 | endif() 25 | # ==================================================================================== 26 | set(PICO_BOARD pico_w CACHE STRING "Board type") 27 | 28 | include(pico_sdk_import.cmake) 29 | project(blink C CXX ASM) 30 | pico_sdk_init() 31 | add_executable(blink blink.c) 32 | target_link_libraries(blink pico_stdlib) 33 | pico_add_extra_outputs(blink) 34 | 35 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/blink.c: -------------------------------------------------------------------------------- 1 | /* 2 | Por: Wilton Lacerda Silva 3 | 4 | Uso do LED RGB da placa BitDogLab. 5 | Também será utilizado o Wokwi para simular o código. 6 | O LED tricolor (RGB) é composto por 3 LEDs no mesmo encapsulamento: 7 | Vermelho(R), Verde(G) e o Azul(B). 8 | O código a seguir faz com que o um dos LEDs RGB, selecionado pela definição 9 | led_pin_red, pisque por um período dado na variável inteira "tempo". 10 | 11 | O código foi testado na placa Raspberry Pi Pico. 12 | Para mais informações sobre a placa BitDogLab acesse: 13 | https://github.com/Fruett/BitDogLab 14 | Para mais informações sobre a placa Raspberry Pi Pico acesse: 15 | https://www.raspberrypi.org/products/raspberry-pi-pico/ 16 | Para mais informações sobre o código Wokwi acesse: 17 | https://wokwi.com/projects/418071361765683201 18 | 19 | */ 20 | 21 | 22 | #include "pico/stdlib.h" 23 | 24 | #define led_pin_red 13 25 | int tempo = 1000; 26 | 27 | int main() { 28 | gpio_init(led_pin_red); 29 | gpio_set_dir(led_pin_red, GPIO_OUT); 30 | 31 | while (true) { 32 | gpio_put(led_pin_red, true); 33 | sleep_ms(tempo); 34 | gpio_put(led_pin_red, false); 35 | sleep_ms(tempo); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated Cmake Pico project file 2 | 3 | cmake_minimum_required(VERSION 3.13) 4 | 5 | set(CMAKE_C_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 8 | 9 | # Initialise pico_sdk from installed location 10 | # (note this can come from environment, CMake cache etc) 11 | 12 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 13 | if(WIN32) 14 | set(USERHOME $ENV{USERPROFILE}) 15 | else() 16 | set(USERHOME $ENV{HOME}) 17 | endif() 18 | set(sdkVersion 2.1.0) 19 | set(toolchainVersion 13_3_Rel1) 20 | set(picotoolVersion 2.1.0) 21 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 22 | if (EXISTS ${picoVscode}) 23 | include(${picoVscode}) 24 | endif() 25 | # ==================================================================================== 26 | set(PICO_BOARD pico_w CACHE STRING "Board type") 27 | 28 | # Pull in Raspberry Pi Pico SDK (must be before project) 29 | include(pico_sdk_import.cmake) 30 | 31 | 32 | project(blink C CXX ASM) 33 | 34 | # Initialise the Raspberry Pi Pico SDK 35 | pico_sdk_init() 36 | 37 | # Add executable. Default name is the project name, version 0.1 38 | 39 | add_executable(blink 40 | blink.c 41 | ) 42 | 43 | # pull in common dependencies 44 | target_link_libraries(blink pico_stdlib) 45 | 46 | if (PICO_CYW43_SUPPORTED) 47 | target_link_libraries(blink pico_cyw43_arch_none) 48 | endif() 49 | 50 | # create map/bin/hex file etc. 51 | pico_add_extra_outputs(blink) 52 | 53 | -------------------------------------------------------------------------------- /blink_print/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated Cmake Pico project file 2 | 3 | cmake_minimum_required(VERSION 3.13) 4 | 5 | set(CMAKE_C_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 8 | 9 | # Initialise pico_sdk from installed location 10 | # (note this can come from environment, CMake cache etc) 11 | 12 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 13 | if(WIN32) 14 | set(USERHOME $ENV{USERPROFILE}) 15 | else() 16 | set(USERHOME $ENV{HOME}) 17 | endif() 18 | set(sdkVersion 2.1.0) 19 | set(toolchainVersion 13_3_Rel1) 20 | set(picotoolVersion 2.1.0) 21 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 22 | if (EXISTS ${picoVscode}) 23 | include(${picoVscode}) 24 | endif() 25 | # ==================================================================================== 26 | set(PICO_BOARD pico_w CACHE STRING "Board type") 27 | 28 | # Pull in Raspberry Pi Pico SDK (must be before project) 29 | include(pico_sdk_import.cmake) 30 | 31 | 32 | project(blink C CXX ASM) 33 | 34 | # Initialise the Raspberry Pi Pico SDK 35 | pico_sdk_init() 36 | 37 | # Add executable. Default name is the project name, version 0.1 38 | 39 | add_executable(blink 40 | blink.c 41 | ) 42 | 43 | # pull in common dependencies 44 | target_link_libraries(blink pico_stdlib) 45 | 46 | pico_enable_stdio_uart(blink 0) 47 | pico_enable_stdio_usb(blink 1) 48 | 49 | 50 | 51 | if (PICO_CYW43_SUPPORTED) 52 | target_link_libraries(blink pico_cyw43_arch_none) 53 | endif() 54 | 55 | # create map/bin/hex file etc. 56 | pico_add_extra_outputs(blink) 57 | 58 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated Cmake Pico project file 2 | 3 | cmake_minimum_required(VERSION 3.13) 4 | 5 | set(CMAKE_C_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 8 | 9 | # Initialise pico_sdk from installed location 10 | # (note this can come from environment, CMake cache etc) 11 | 12 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 13 | if(WIN32) 14 | set(USERHOME $ENV{USERPROFILE}) 15 | else() 16 | set(USERHOME $ENV{HOME}) 17 | endif() 18 | set(sdkVersion 2.1.0) 19 | set(toolchainVersion 13_3_Rel1) 20 | set(picotoolVersion 2.1.0) 21 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 22 | if (EXISTS ${picoVscode}) 23 | include(${picoVscode}) 24 | endif() 25 | # ==================================================================================== 26 | set(PICO_BOARD pico_w CACHE STRING "Board type") 27 | 28 | # Pull in Raspberry Pi Pico SDK (must be before project) 29 | include(pico_sdk_import.cmake) 30 | 31 | 32 | project(blink C CXX ASM) 33 | 34 | # Initialise the Raspberry Pi Pico SDK 35 | pico_sdk_init() 36 | 37 | # Add executable. Default name is the project name, version 0.1 38 | 39 | add_executable(blink 40 | blink.c 41 | ) 42 | 43 | # pull in common dependencies 44 | target_link_libraries(blink pico_stdlib) 45 | 46 | if (PICO_CYW43_SUPPORTED) 47 | target_link_libraries(blink pico_cyw43_arch_none) 48 | endif() 49 | 50 | # create map/bin/hex file etc. 51 | pico_add_extra_outputs(blink) 52 | 53 | # add url via pico_set_program_url 54 | pico_enable_stdio_usb(blink 1) 55 | pico_enable_stdio_uart(blink 1) -------------------------------------------------------------------------------- /LedRGBWokwi/LedTricolor.c: -------------------------------------------------------------------------------- 1 | /* 2 | Por: Wilton Lacerda Silva 3 | 4 | Uso do LED tricolor da placa BitDogLab. 5 | Também será utilizado o Wokwi para simular o código. 6 | O LED tricolor (RGB) é composto por 3 LEDs no mesmo encapsulamento: 7 | Vermelho(R), Verde(G) e o Azul(B). 8 | 9 | O código a seguir faz com que o LED RGB pisque de forma sequencial: 10 | primeiro o verde, depois o azul e por último o vermelho. 11 | 12 | O tempo de cada piscada é de 900ms para o verde, 600ms para o azul e 13 | 300ms para o vermelho. 14 | 15 | O código foi testado na placa Raspberry Pi Pico. 16 | Para mais informações sobre a placa BitDogLab acesse: 17 | https://github.com/Fruett/BitDogLab 18 | Para mais informações sobre a placa Raspberry Pi Pico acesse: 19 | https://www.raspberrypi.org/products/raspberry-pi-pico/ 20 | Para mais informações sobre o código Wokwi acesse: 21 | https://wokwi.com/projects/418071766652353537 22 | 23 | */ 24 | 25 | #include 26 | #include "pico/stdlib.h" 27 | 28 | 29 | const uint led_pin_green = 11; 30 | const uint led_pin_blue = 12; 31 | const uint led_pin_red = 13; 32 | 33 | 34 | int main() 35 | { 36 | gpio_init(led_pin_green); 37 | gpio_set_dir(led_pin_green, GPIO_OUT); 38 | gpio_init(led_pin_blue); 39 | gpio_set_dir(led_pin_blue, GPIO_OUT); 40 | gpio_init(led_pin_red); 41 | gpio_set_dir(led_pin_red, GPIO_OUT); 42 | 43 | while (true) { 44 | gpio_put(led_pin_green, true); 45 | sleep_ms(900); 46 | gpio_put(led_pin_green, false); 47 | sleep_ms(900); 48 | gpio_put(led_pin_blue, true); 49 | sleep_ms(600); 50 | gpio_put(led_pin_blue, false); 51 | sleep_ms(600); 52 | gpio_put(led_pin_red, true); 53 | sleep_ms(300); 54 | gpio_put(led_pin_red, false); 55 | sleep_ms(300); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /LedRGBWokwi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated Cmake Pico project file 2 | 3 | cmake_minimum_required(VERSION 3.13) 4 | 5 | set(CMAKE_C_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 8 | 9 | # Initialise pico_sdk from installed location 10 | # (note this can come from environment, CMake cache etc) 11 | 12 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 13 | if(WIN32) 14 | set(USERHOME $ENV{USERPROFILE}) 15 | else() 16 | set(USERHOME $ENV{HOME}) 17 | endif() 18 | set(sdkVersion 2.1.0) 19 | set(toolchainVersion 13_3_Rel1) 20 | set(picotoolVersion 2.1.0) 21 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 22 | if (EXISTS ${picoVscode}) 23 | include(${picoVscode}) 24 | endif() 25 | # ==================================================================================== 26 | set(PICO_BOARD pico_w CACHE STRING "Board type") 27 | 28 | # Pull in Raspberry Pi Pico SDK (must be before project) 29 | include(pico_sdk_import.cmake) 30 | 31 | project(LedTricolor C CXX ASM) 32 | 33 | # Initialise the Raspberry Pi Pico SDK 34 | pico_sdk_init() 35 | 36 | # Add executable. Default name is the project name, version 0.1 37 | 38 | add_executable(LedTricolor LedTricolor.c ) 39 | 40 | pico_set_program_name(LedTricolor "LedTricolor") 41 | pico_set_program_version(LedTricolor "0.1") 42 | 43 | # Modify the below lines to enable/disable output over UART/USB 44 | pico_enable_stdio_uart(LedTricolor 1) 45 | pico_enable_stdio_usb(LedTricolor 0) 46 | 47 | # Add the standard library to the build 48 | target_link_libraries(LedTricolor 49 | pico_stdlib) 50 | 51 | # Add the standard include files to the build 52 | target_include_directories(LedTricolor PRIVATE 53 | ${CMAKE_CURRENT_LIST_DIR} 54 | ) 55 | 56 | # Add any user requested libraries 57 | target_link_libraries(LedTricolor 58 | pico_cyw43_arch_none 59 | ) 60 | 61 | pico_add_extra_outputs(LedTricolor) 62 | 63 | -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.options.statusBarVisibility": "hidden", 3 | "cmake.options.advanced": { 4 | "build": { 5 | "statusBarVisibility": "hidden" 6 | }, 7 | "launch": { 8 | "statusBarVisibility": "hidden" 9 | }, 10 | "debug": { 11 | "statusBarVisibility": "hidden" 12 | } 13 | }, 14 | "cmake.configureOnEdit": false, 15 | "cmake.automaticReconfigure": false, 16 | "cmake.configureOnOpen": false, 17 | "cmake.generator": "Ninja", 18 | "cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.6/bin/cmake", 19 | "C_Cpp.debugShortcut": false, 20 | "terminal.integrated.env.windows": { 21 | "PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/2.0.0", 22 | "PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", 23 | "Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1;${env:PATH}" 24 | }, 25 | "terminal.integrated.env.osx": { 26 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 27 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 28 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 29 | }, 30 | "terminal.integrated.env.linux": { 31 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 32 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 33 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 34 | }, 35 | "raspberry-pi-pico.cmakeAutoConfigure": true, 36 | "raspberry-pi-pico.useCmakeTools": false, 37 | "raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake", 38 | "raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.12.1/ninja" 39 | } 40 | -------------------------------------------------------------------------------- /Mblink_a_vscode_sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 2 | if(WIN32) 3 | set(USERHOME $ENV{USERPROFILE}) 4 | else() 5 | set(USERHOME $ENV{HOME}) 6 | endif() 7 | set(sdkVersion 2.1.0) 8 | set(toolchainVersion 13_3_Rel1) 9 | set(picotoolVersion 2.1.0) 10 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 11 | if (EXISTS ${picoVscode}) 12 | include(${picoVscode}) 13 | endif() 14 | # ==================================================================================== 15 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 16 | if(WIN32) 17 | set(USERHOME $ENV{USERPROFILE}) 18 | else() 19 | set(USERHOME $ENV{HOME}) 20 | endif() 21 | set(sdkVersion 2.1.0) 22 | set(toolchainVersion 13_3_Rel1) 23 | set(picotoolVersion 2.1.0) 24 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 25 | if (EXISTS ${picoVscode}) 26 | include(${picoVscode}) 27 | endif() 28 | # ==================================================================================== 29 | # Generated Cmake Pico project file 30 | 31 | cmake_minimum_required(VERSION 3.13) 32 | 33 | set(CMAKE_C_STANDARD 11) 34 | set(CMAKE_CXX_STANDARD 17) 35 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 36 | 37 | # Initialise pico_sdk from installed location 38 | # (note this can come from environment, CMake cache etc) 39 | 40 | # == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == 41 | if(WIN32) 42 | set(USERHOME $ENV{USERPROFILE}) 43 | else() 44 | set(USERHOME $ENV{HOME}) 45 | endif() 46 | set(sdkVersion 2.1.0) 47 | set(toolchainVersion 13_3_Rel1) 48 | set(picotoolVersion 2.1.0) 49 | set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) 50 | if (EXISTS ${picoVscode}) 51 | include(${picoVscode}) 52 | endif() 53 | # ==================================================================================== 54 | set(PICO_BOARD pico_w CACHE STRING "Board type") 55 | 56 | include(pico_sdk_import.cmake) 57 | project(blink C CXX ASM) 58 | pico_sdk_init() 59 | add_executable(blink blink.c) 60 | target_link_libraries(blink pico_stdlib) 61 | pico_add_extra_outputs(blink) 62 | 63 | -------------------------------------------------------------------------------- /blink_a/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Project", 6 | "type": "process", 7 | "isBuildCommand": true, 8 | "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", 9 | "args": ["-C", "${workspaceFolder}/build"], 10 | "group": "build", 11 | "presentation": { 12 | "reveal": "always", 13 | "panel": "dedicated" 14 | }, 15 | "problemMatcher": "$gcc", 16 | "windows": { 17 | "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" 18 | } 19 | }, 20 | { 21 | "label": "Run Project", 22 | "type": "process", 23 | "command": "${env:HOME}/.pico-sdk/picotool/2.0.0/picotool/picotool", 24 | "args": [ 25 | "load", 26 | "${command:raspberry-pi-pico.launchTargetPath}", 27 | "-fx" 28 | ], 29 | "presentation": { 30 | "reveal": "always", 31 | "panel": "dedicated" 32 | }, 33 | "problemMatcher": [], 34 | "windows": { 35 | "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool/picotool.exe" 36 | } 37 | }, 38 | { 39 | "label": "Flash", 40 | "type": "process", 41 | "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 42 | "args": [ 43 | "-s", 44 | "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 45 | "-f", 46 | "interface/cmsis-dap.cfg", 47 | "-f", 48 | "target/${command:raspberry-pi-pico.getTarget}.cfg", 49 | "-c", 50 | "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" 51 | ], 52 | "problemMatcher": [], 53 | "windows": { 54 | "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Project", 6 | "type": "process", 7 | "isBuildCommand": true, 8 | "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", 9 | "args": ["-C", "${workspaceFolder}/build"], 10 | "group": "build", 11 | "presentation": { 12 | "reveal": "always", 13 | "panel": "dedicated" 14 | }, 15 | "problemMatcher": "$gcc", 16 | "windows": { 17 | "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" 18 | } 19 | }, 20 | { 21 | "label": "Run Project", 22 | "type": "process", 23 | "command": "${env:HOME}/.pico-sdk/picotool/2.0.0/picotool/picotool", 24 | "args": [ 25 | "load", 26 | "${command:raspberry-pi-pico.launchTargetPath}", 27 | "-fx" 28 | ], 29 | "presentation": { 30 | "reveal": "always", 31 | "panel": "dedicated" 32 | }, 33 | "problemMatcher": [], 34 | "windows": { 35 | "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool/picotool.exe" 36 | } 37 | }, 38 | { 39 | "label": "Flash", 40 | "type": "process", 41 | "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 42 | "args": [ 43 | "-s", 44 | "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 45 | "-f", 46 | "interface/cmsis-dap.cfg", 47 | "-f", 48 | "target/${command:raspberry-pi-pico.getTarget}.cfg", 49 | "-c", 50 | "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" 51 | ], 52 | "problemMatcher": [], 53 | "windows": { 54 | "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /blink_print/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Project", 6 | "type": "process", 7 | "isBuildCommand": true, 8 | "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", 9 | "args": ["-C", "${workspaceFolder}/build"], 10 | "group": "build", 11 | "presentation": { 12 | "reveal": "always", 13 | "panel": "dedicated" 14 | }, 15 | "problemMatcher": "$gcc", 16 | "windows": { 17 | "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" 18 | } 19 | }, 20 | { 21 | "label": "Run Project", 22 | "type": "process", 23 | "command": "${env:HOME}/.pico-sdk/picotool/2.0.0/picotool/picotool", 24 | "args": [ 25 | "load", 26 | "${command:raspberry-pi-pico.launchTargetPath}", 27 | "-fx" 28 | ], 29 | "presentation": { 30 | "reveal": "always", 31 | "panel": "dedicated" 32 | }, 33 | "problemMatcher": [], 34 | "windows": { 35 | "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool/picotool.exe" 36 | } 37 | }, 38 | { 39 | "label": "Flash", 40 | "type": "process", 41 | "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 42 | "args": [ 43 | "-s", 44 | "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 45 | "-f", 46 | "interface/cmsis-dap.cfg", 47 | "-f", 48 | "target/${command:raspberry-pi-pico.getTarget}.cfg", 49 | "-c", 50 | "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" 51 | ], 52 | "problemMatcher": [], 53 | "windows": { 54 | "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Project", 6 | "type": "process", 7 | "isBuildCommand": true, 8 | "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", 9 | "args": ["-C", "${workspaceFolder}/build"], 10 | "group": "build", 11 | "presentation": { 12 | "reveal": "always", 13 | "panel": "dedicated" 14 | }, 15 | "problemMatcher": "$gcc", 16 | "windows": { 17 | "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" 18 | } 19 | }, 20 | { 21 | "label": "Run Project", 22 | "type": "process", 23 | "command": "${env:HOME}/.pico-sdk/picotool/2.0.0/picotool/picotool", 24 | "args": [ 25 | "load", 26 | "${command:raspberry-pi-pico.launchTargetPath}", 27 | "-fx" 28 | ], 29 | "presentation": { 30 | "reveal": "always", 31 | "panel": "dedicated" 32 | }, 33 | "problemMatcher": [], 34 | "windows": { 35 | "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool/picotool.exe" 36 | } 37 | }, 38 | { 39 | "label": "Flash", 40 | "type": "process", 41 | "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 42 | "args": [ 43 | "-s", 44 | "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 45 | "-f", 46 | "interface/cmsis-dap.cfg", 47 | "-f", 48 | "target/${command:raspberry-pi-pico.getTarget}.cfg", 49 | "-c", 50 | "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" 51 | ], 52 | "problemMatcher": [], 53 | "windows": { 54 | "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Compile Project", 6 | "type": "process", 7 | "isBuildCommand": true, 8 | "command": "${userHome}/.pico-sdk/ninja/v1.12.1/ninja", 9 | "args": ["-C", "${workspaceFolder}/build"], 10 | "group": "build", 11 | "presentation": { 12 | "reveal": "always", 13 | "panel": "dedicated" 14 | }, 15 | "problemMatcher": "$gcc", 16 | "windows": { 17 | "command": "${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1/ninja.exe" 18 | } 19 | }, 20 | { 21 | "label": "Run Project", 22 | "type": "process", 23 | "command": "${env:HOME}/.pico-sdk/picotool/2.0.0/picotool/picotool", 24 | "args": [ 25 | "load", 26 | "${command:raspberry-pi-pico.launchTargetPath}", 27 | "-fx" 28 | ], 29 | "presentation": { 30 | "reveal": "always", 31 | "panel": "dedicated" 32 | }, 33 | "problemMatcher": [], 34 | "windows": { 35 | "command": "${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool/picotool.exe" 36 | } 37 | }, 38 | { 39 | "label": "Flash", 40 | "type": "process", 41 | "command": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 42 | "args": [ 43 | "-s", 44 | "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 45 | "-f", 46 | "interface/cmsis-dap.cfg", 47 | "-f", 48 | "target/${command:raspberry-pi-pico.getTarget}.cfg", 49 | "-c", 50 | "adapter speed 5000; program \"${command:raspberry-pi-pico.launchTargetPath}\" verify reset exit" 51 | ], 52 | "problemMatcher": [], 53 | "windows": { 54 | "command": "${env:USERPROFILE}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /blink_a/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.options.statusBarVisibility": "hidden", 3 | "cmake.options.advanced": { 4 | "build": { 5 | "statusBarVisibility": "hidden" 6 | }, 7 | "launch": { 8 | "statusBarVisibility": "hidden" 9 | }, 10 | "debug": { 11 | "statusBarVisibility": "hidden" 12 | } 13 | }, 14 | "cmake.configureOnEdit": false, 15 | "cmake.automaticReconfigure": false, 16 | "cmake.configureOnOpen": false, 17 | "cmake.generator": "Ninja", 18 | "cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.6/bin/cmake", 19 | "C_Cpp.debugShortcut": false, 20 | "terminal.integrated.env.windows": { 21 | "PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/2.0.0", 22 | "PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", 23 | "Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1;${env:PATH}" 24 | }, 25 | "terminal.integrated.env.osx": { 26 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 27 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 28 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 29 | }, 30 | "terminal.integrated.env.linux": { 31 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 32 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 33 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 34 | }, 35 | "raspberry-pi-pico.cmakeAutoConfigure": true, 36 | "raspberry-pi-pico.useCmakeTools": false, 37 | "raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake", 38 | "raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.12.1/ninja", 39 | "files.associations": { 40 | "stdlib.h": "c" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /blink_print/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.options.statusBarVisibility": "hidden", 3 | "cmake.options.advanced": { 4 | "build": { 5 | "statusBarVisibility": "hidden" 6 | }, 7 | "launch": { 8 | "statusBarVisibility": "hidden" 9 | }, 10 | "debug": { 11 | "statusBarVisibility": "hidden" 12 | } 13 | }, 14 | "cmake.configureOnEdit": false, 15 | "cmake.automaticReconfigure": false, 16 | "cmake.configureOnOpen": false, 17 | "cmake.generator": "Ninja", 18 | "cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.6/bin/cmake", 19 | "C_Cpp.debugShortcut": false, 20 | "terminal.integrated.env.windows": { 21 | "PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/2.0.0", 22 | "PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", 23 | "Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1;${env:PATH}" 24 | }, 25 | "terminal.integrated.env.osx": { 26 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 27 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 28 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 29 | }, 30 | "terminal.integrated.env.linux": { 31 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 32 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 33 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 34 | }, 35 | "raspberry-pi-pico.cmakeAutoConfigure": true, 36 | "raspberry-pi-pico.useCmakeTools": false, 37 | "raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake", 38 | "raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.12.1/ninja", 39 | "files.associations": { 40 | "stdlib.h": "c" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.options.statusBarVisibility": "hidden", 3 | "cmake.options.advanced": { 4 | "build": { 5 | "statusBarVisibility": "hidden" 6 | }, 7 | "launch": { 8 | "statusBarVisibility": "hidden" 9 | }, 10 | "debug": { 11 | "statusBarVisibility": "hidden" 12 | } 13 | }, 14 | "cmake.configureOnEdit": false, 15 | "cmake.automaticReconfigure": false, 16 | "cmake.configureOnOpen": false, 17 | "cmake.generator": "Ninja", 18 | "cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.6/bin/cmake", 19 | "C_Cpp.debugShortcut": false, 20 | "terminal.integrated.env.windows": { 21 | "PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/2.0.0", 22 | "PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", 23 | "Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1;${env:PATH}" 24 | }, 25 | "terminal.integrated.env.osx": { 26 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 27 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 28 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 29 | }, 30 | "terminal.integrated.env.linux": { 31 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 32 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 33 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 34 | }, 35 | "raspberry-pi-pico.cmakeAutoConfigure": true, 36 | "raspberry-pi-pico.useCmakeTools": false, 37 | "raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake", 38 | "raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.12.1/ninja", 39 | "files.associations": { 40 | "stdlib.h": "c" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.options.statusBarVisibility": "hidden", 3 | "cmake.options.advanced": { 4 | "build": { 5 | "statusBarVisibility": "hidden" 6 | }, 7 | "launch": { 8 | "statusBarVisibility": "hidden" 9 | }, 10 | "debug": { 11 | "statusBarVisibility": "hidden" 12 | } 13 | }, 14 | "cmake.configureOnEdit": false, 15 | "cmake.automaticReconfigure": false, 16 | "cmake.configureOnOpen": false, 17 | "cmake.generator": "Ninja", 18 | "cmake.cmakePath": "${userHome}/.pico-sdk/cmake/v3.28.6/bin/cmake", 19 | "C_Cpp.debugShortcut": false, 20 | "terminal.integrated.env.windows": { 21 | "PICO_SDK_PATH": "${env:USERPROFILE}/.pico-sdk/sdk/2.0.0", 22 | "PICO_TOOLCHAIN_PATH": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1", 23 | "Path": "${env:USERPROFILE}/.pico-sdk/toolchain/13_2_Rel1/bin;${env:USERPROFILE}/.pico-sdk/picotool/2.0.0/picotool;${env:USERPROFILE}/.pico-sdk/cmake/v3.28.6/bin;${env:USERPROFILE}/.pico-sdk/ninja/v1.12.1;${env:PATH}" 24 | }, 25 | "terminal.integrated.env.osx": { 26 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 27 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 28 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 29 | }, 30 | "terminal.integrated.env.linux": { 31 | "PICO_SDK_PATH": "${env:HOME}/.pico-sdk/sdk/2.0.0", 32 | "PICO_TOOLCHAIN_PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1", 33 | "PATH": "${env:HOME}/.pico-sdk/toolchain/13_2_Rel1/bin:${env:HOME}/.pico-sdk/picotool/2.0.0/picotool:${env:HOME}/.pico-sdk/cmake/v3.28.6/bin:${env:HOME}/.pico-sdk/ninja/v1.12.1:${env:PATH}" 34 | }, 35 | "raspberry-pi-pico.cmakeAutoConfigure": true, 36 | "raspberry-pi-pico.useCmakeTools": false, 37 | "raspberry-pi-pico.cmakePath": "${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake", 38 | "raspberry-pi-pico.ninjaPath": "${HOME}/.pico-sdk/ninja/v1.12.1/ninja", 39 | "files.associations": { 40 | "stdlib.h": "c" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /LedRGBWokwi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug (Cortex-Debug)", 6 | "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 7 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 12 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 13 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 14 | "configFiles": [ 15 | "interface/cmsis-dap.cfg", 16 | "target/${command:raspberry-pi-pico.getTarget}.cfg" 17 | ], 18 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 19 | "runToEntryPoint": "main", 20 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 21 | // Also works fine for flash binaries 22 | "overrideLaunchCommands": [ 23 | "monitor reset init", 24 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 25 | ], 26 | "openOCDLaunchCommands": [ 27 | "adapter speed 5000" 28 | ] 29 | }, 30 | { 31 | "name": "Pico Debug (Cortex-Debug with external OpenOCD)", 32 | "cwd": "${workspaceRoot}", 33 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 34 | "request": "launch", 35 | "type": "cortex-debug", 36 | "servertype": "external", 37 | "gdbTarget": "localhost:3333", 38 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 39 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 40 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 41 | "runToEntryPoint": "main", 42 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 43 | // Also works fine for flash binaries 44 | "overrideLaunchCommands": [ 45 | "monitor reset init", 46 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 47 | ] 48 | }, 49 | { 50 | "name": "Pico Debug (C++ Debugger)", 51 | "type": "cppdbg", 52 | "request": "launch", 53 | "cwd": "${workspaceRoot}", 54 | "program": "${command:raspberry-pi-pico.launchTargetPath}", 55 | "MIMode": "gdb", 56 | "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 59 | "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", 60 | "serverStarted": "Listening on port .* for gdb connections", 61 | "filterStderr": true, 62 | "hardwareBreakpoints": { 63 | "require": true, 64 | "limit": 4 65 | }, 66 | "preLaunchTask": "Flash", 67 | "svdPath": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" 68 | }, 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /blink_a/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug (Cortex-Debug)", 6 | "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 7 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 12 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 13 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 14 | "configFiles": [ 15 | "interface/cmsis-dap.cfg", 16 | "target/${command:raspberry-pi-pico.getTarget}.cfg" 17 | ], 18 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 19 | "runToEntryPoint": "main", 20 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 21 | // Also works fine for flash binaries 22 | "overrideLaunchCommands": [ 23 | "monitor reset init", 24 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 25 | ], 26 | "openOCDLaunchCommands": [ 27 | "adapter speed 5000" 28 | ] 29 | }, 30 | { 31 | "name": "Pico Debug (Cortex-Debug with external OpenOCD)", 32 | "cwd": "${workspaceRoot}", 33 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 34 | "request": "launch", 35 | "type": "cortex-debug", 36 | "servertype": "external", 37 | "gdbTarget": "localhost:3333", 38 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 39 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 40 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 41 | "runToEntryPoint": "main", 42 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 43 | // Also works fine for flash binaries 44 | "overrideLaunchCommands": [ 45 | "monitor reset init", 46 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 47 | ] 48 | }, 49 | { 50 | "name": "Pico Debug (C++ Debugger)", 51 | "type": "cppdbg", 52 | "request": "launch", 53 | "cwd": "${workspaceRoot}", 54 | "program": "${command:raspberry-pi-pico.launchTargetPath}", 55 | "MIMode": "gdb", 56 | "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 59 | "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", 60 | "serverStarted": "Listening on port .* for gdb connections", 61 | "filterStderr": true, 62 | "hardwareBreakpoints": { 63 | "require": true, 64 | "limit": 4 65 | }, 66 | "preLaunchTask": "Flash", 67 | "svdPath": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" 68 | }, 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /blink_print/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug (Cortex-Debug)", 6 | "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 7 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 12 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 13 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 14 | "configFiles": [ 15 | "interface/cmsis-dap.cfg", 16 | "target/${command:raspberry-pi-pico.getTarget}.cfg" 17 | ], 18 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 19 | "runToEntryPoint": "main", 20 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 21 | // Also works fine for flash binaries 22 | "overrideLaunchCommands": [ 23 | "monitor reset init", 24 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 25 | ], 26 | "openOCDLaunchCommands": [ 27 | "adapter speed 5000" 28 | ] 29 | }, 30 | { 31 | "name": "Pico Debug (Cortex-Debug with external OpenOCD)", 32 | "cwd": "${workspaceRoot}", 33 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 34 | "request": "launch", 35 | "type": "cortex-debug", 36 | "servertype": "external", 37 | "gdbTarget": "localhost:3333", 38 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 39 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 40 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 41 | "runToEntryPoint": "main", 42 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 43 | // Also works fine for flash binaries 44 | "overrideLaunchCommands": [ 45 | "monitor reset init", 46 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 47 | ] 48 | }, 49 | { 50 | "name": "Pico Debug (C++ Debugger)", 51 | "type": "cppdbg", 52 | "request": "launch", 53 | "cwd": "${workspaceRoot}", 54 | "program": "${command:raspberry-pi-pico.launchTargetPath}", 55 | "MIMode": "gdb", 56 | "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 59 | "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", 60 | "serverStarted": "Listening on port .* for gdb connections", 61 | "filterStderr": true, 62 | "hardwareBreakpoints": { 63 | "require": true, 64 | "limit": 4 65 | }, 66 | "preLaunchTask": "Flash", 67 | "svdPath": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" 68 | }, 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug (Cortex-Debug)", 6 | "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 7 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 12 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 13 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 14 | "configFiles": [ 15 | "interface/cmsis-dap.cfg", 16 | "target/${command:raspberry-pi-pico.getTarget}.cfg" 17 | ], 18 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 19 | "runToEntryPoint": "main", 20 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 21 | // Also works fine for flash binaries 22 | "overrideLaunchCommands": [ 23 | "monitor reset init", 24 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 25 | ], 26 | "openOCDLaunchCommands": [ 27 | "adapter speed 5000" 28 | ] 29 | }, 30 | { 31 | "name": "Pico Debug (Cortex-Debug with external OpenOCD)", 32 | "cwd": "${workspaceRoot}", 33 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 34 | "request": "launch", 35 | "type": "cortex-debug", 36 | "servertype": "external", 37 | "gdbTarget": "localhost:3333", 38 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 39 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 40 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 41 | "runToEntryPoint": "main", 42 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 43 | // Also works fine for flash binaries 44 | "overrideLaunchCommands": [ 45 | "monitor reset init", 46 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 47 | ] 48 | }, 49 | { 50 | "name": "Pico Debug (C++ Debugger)", 51 | "type": "cppdbg", 52 | "request": "launch", 53 | "cwd": "${workspaceRoot}", 54 | "program": "${command:raspberry-pi-pico.launchTargetPath}", 55 | "MIMode": "gdb", 56 | "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 59 | "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", 60 | "serverStarted": "Listening on port .* for gdb connections", 61 | "filterStderr": true, 62 | "hardwareBreakpoints": { 63 | "require": true, 64 | "limit": 4 65 | }, 66 | "preLaunchTask": "Flash", 67 | "svdPath": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" 68 | }, 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug (Cortex-Debug)", 6 | "cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts", 7 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "serverpath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 12 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 13 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 14 | "configFiles": [ 15 | "interface/cmsis-dap.cfg", 16 | "target/${command:raspberry-pi-pico.getTarget}.cfg" 17 | ], 18 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 19 | "runToEntryPoint": "main", 20 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 21 | // Also works fine for flash binaries 22 | "overrideLaunchCommands": [ 23 | "monitor reset init", 24 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 25 | ], 26 | "openOCDLaunchCommands": [ 27 | "adapter speed 5000" 28 | ] 29 | }, 30 | { 31 | "name": "Pico Debug (Cortex-Debug with external OpenOCD)", 32 | "cwd": "${workspaceRoot}", 33 | "executable": "${command:raspberry-pi-pico.launchTargetPath}", 34 | "request": "launch", 35 | "type": "cortex-debug", 36 | "servertype": "external", 37 | "gdbTarget": "localhost:3333", 38 | "gdbPath": "${command:raspberry-pi-pico.getGDBPath}", 39 | "device": "${command:raspberry-pi-pico.getChipUppercase}", 40 | "svdFile": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd", 41 | "runToEntryPoint": "main", 42 | // Fix for no_flash binaries, where monitor reset halt doesn't do what is expected 43 | // Also works fine for flash binaries 44 | "overrideLaunchCommands": [ 45 | "monitor reset init", 46 | "load \"${command:raspberry-pi-pico.launchTargetPath}\"" 47 | ] 48 | }, 49 | { 50 | "name": "Pico Debug (C++ Debugger)", 51 | "type": "cppdbg", 52 | "request": "launch", 53 | "cwd": "${workspaceRoot}", 54 | "program": "${command:raspberry-pi-pico.launchTargetPath}", 55 | "MIMode": "gdb", 56 | "miDebuggerPath": "${command:raspberry-pi-pico.getGDBPath}", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "debugServerPath": "${userHome}/.pico-sdk/openocd/0.12.0+dev/openocd.exe", 59 | "debugServerArgs": "-f interface/cmsis-dap.cfg -f target/${command:raspberry-pi-pico.getTarget}.cfg -c \"adapter speed 5000\"", 60 | "serverStarted": "Listening on port .* for gdb connections", 61 | "filterStderr": true, 62 | "hardwareBreakpoints": { 63 | "require": true, 64 | "limit": 4 65 | }, 66 | "preLaunchTask": "Flash", 67 | "svdPath": "${userHome}/.pico-sdk/sdk/2.0.0/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd" 68 | }, 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /blink_a/pico_sdk_import.cmake: -------------------------------------------------------------------------------- 1 | # This is a copy of /external/pico_sdk_import.cmake 2 | 3 | # This can be dropped into an external project to help locate this SDK 4 | # It should be include()ed prior to project() 5 | 6 | if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) 7 | set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) 8 | message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") 9 | endif () 10 | 11 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) 12 | set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) 13 | message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") 14 | endif () 15 | 16 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) 17 | set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) 18 | message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") 19 | endif () 20 | 21 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) 22 | set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) 23 | message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") 24 | endif () 25 | 26 | if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) 27 | set(PICO_SDK_FETCH_FROM_GIT_TAG "master") 28 | message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") 29 | endif() 30 | 31 | set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") 32 | set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") 33 | set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") 34 | set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") 35 | 36 | if (NOT PICO_SDK_PATH) 37 | if (PICO_SDK_FETCH_FROM_GIT) 38 | include(FetchContent) 39 | set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) 40 | if (PICO_SDK_FETCH_FROM_GIT_PATH) 41 | get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") 42 | endif () 43 | # GIT_SUBMODULES_RECURSE was added in 3.17 44 | if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") 45 | FetchContent_Declare( 46 | pico_sdk 47 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 48 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 49 | GIT_SUBMODULES_RECURSE FALSE 50 | ) 51 | else () 52 | FetchContent_Declare( 53 | pico_sdk 54 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 55 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 56 | ) 57 | endif () 58 | 59 | if (NOT pico_sdk) 60 | message("Downloading Raspberry Pi Pico SDK") 61 | FetchContent_Populate(pico_sdk) 62 | set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) 63 | endif () 64 | set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) 65 | else () 66 | message(FATAL_ERROR 67 | "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." 68 | ) 69 | endif () 70 | endif () 71 | 72 | get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") 73 | if (NOT EXISTS ${PICO_SDK_PATH}) 74 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") 75 | endif () 76 | 77 | set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) 78 | if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) 79 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") 80 | endif () 81 | 82 | set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) 83 | 84 | include(${PICO_SDK_INIT_CMAKE_FILE}) 85 | -------------------------------------------------------------------------------- /LedRGBWokwi/pico_sdk_import.cmake: -------------------------------------------------------------------------------- 1 | # This is a copy of /external/pico_sdk_import.cmake 2 | 3 | # This can be dropped into an external project to help locate this SDK 4 | # It should be include()ed prior to project() 5 | 6 | if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) 7 | set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) 8 | message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") 9 | endif () 10 | 11 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) 12 | set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) 13 | message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") 14 | endif () 15 | 16 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) 17 | set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) 18 | message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") 19 | endif () 20 | 21 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) 22 | set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) 23 | message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") 24 | endif () 25 | 26 | if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) 27 | set(PICO_SDK_FETCH_FROM_GIT_TAG "master") 28 | message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") 29 | endif() 30 | 31 | set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") 32 | set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") 33 | set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") 34 | set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") 35 | 36 | if (NOT PICO_SDK_PATH) 37 | if (PICO_SDK_FETCH_FROM_GIT) 38 | include(FetchContent) 39 | set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) 40 | if (PICO_SDK_FETCH_FROM_GIT_PATH) 41 | get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") 42 | endif () 43 | # GIT_SUBMODULES_RECURSE was added in 3.17 44 | if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") 45 | FetchContent_Declare( 46 | pico_sdk 47 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 48 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 49 | GIT_SUBMODULES_RECURSE FALSE 50 | ) 51 | else () 52 | FetchContent_Declare( 53 | pico_sdk 54 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 55 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 56 | ) 57 | endif () 58 | 59 | if (NOT pico_sdk) 60 | message("Downloading Raspberry Pi Pico SDK") 61 | FetchContent_Populate(pico_sdk) 62 | set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) 63 | endif () 64 | set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) 65 | else () 66 | message(FATAL_ERROR 67 | "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." 68 | ) 69 | endif () 70 | endif () 71 | 72 | get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") 73 | if (NOT EXISTS ${PICO_SDK_PATH}) 74 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") 75 | endif () 76 | 77 | set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) 78 | if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) 79 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") 80 | endif () 81 | 82 | set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) 83 | 84 | include(${PICO_SDK_INIT_CMAKE_FILE}) 85 | -------------------------------------------------------------------------------- /blink_print/pico_sdk_import.cmake: -------------------------------------------------------------------------------- 1 | # This is a copy of /external/pico_sdk_import.cmake 2 | 3 | # This can be dropped into an external project to help locate this SDK 4 | # It should be include()ed prior to project() 5 | 6 | if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) 7 | set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) 8 | message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") 9 | endif () 10 | 11 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) 12 | set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) 13 | message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") 14 | endif () 15 | 16 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) 17 | set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) 18 | message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") 19 | endif () 20 | 21 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) 22 | set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) 23 | message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") 24 | endif () 25 | 26 | if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) 27 | set(PICO_SDK_FETCH_FROM_GIT_TAG "master") 28 | message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") 29 | endif() 30 | 31 | set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") 32 | set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") 33 | set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") 34 | set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") 35 | 36 | if (NOT PICO_SDK_PATH) 37 | if (PICO_SDK_FETCH_FROM_GIT) 38 | include(FetchContent) 39 | set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) 40 | if (PICO_SDK_FETCH_FROM_GIT_PATH) 41 | get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") 42 | endif () 43 | # GIT_SUBMODULES_RECURSE was added in 3.17 44 | if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") 45 | FetchContent_Declare( 46 | pico_sdk 47 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 48 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 49 | GIT_SUBMODULES_RECURSE FALSE 50 | ) 51 | else () 52 | FetchContent_Declare( 53 | pico_sdk 54 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 55 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 56 | ) 57 | endif () 58 | 59 | if (NOT pico_sdk) 60 | message("Downloading Raspberry Pi Pico SDK") 61 | FetchContent_Populate(pico_sdk) 62 | set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) 63 | endif () 64 | set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) 65 | else () 66 | message(FATAL_ERROR 67 | "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." 68 | ) 69 | endif () 70 | endif () 71 | 72 | get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") 73 | if (NOT EXISTS ${PICO_SDK_PATH}) 74 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") 75 | endif () 76 | 77 | set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) 78 | if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) 79 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") 80 | endif () 81 | 82 | set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) 83 | 84 | include(${PICO_SDK_INIT_CMAKE_FILE}) 85 | -------------------------------------------------------------------------------- /blink_a_ComWokwi/pico_sdk_import.cmake: -------------------------------------------------------------------------------- 1 | # This is a copy of /external/pico_sdk_import.cmake 2 | 3 | # This can be dropped into an external project to help locate this SDK 4 | # It should be include()ed prior to project() 5 | 6 | if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) 7 | set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) 8 | message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") 9 | endif () 10 | 11 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) 12 | set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) 13 | message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") 14 | endif () 15 | 16 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) 17 | set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) 18 | message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") 19 | endif () 20 | 21 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) 22 | set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) 23 | message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") 24 | endif () 25 | 26 | if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) 27 | set(PICO_SDK_FETCH_FROM_GIT_TAG "master") 28 | message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") 29 | endif() 30 | 31 | set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") 32 | set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") 33 | set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") 34 | set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") 35 | 36 | if (NOT PICO_SDK_PATH) 37 | if (PICO_SDK_FETCH_FROM_GIT) 38 | include(FetchContent) 39 | set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) 40 | if (PICO_SDK_FETCH_FROM_GIT_PATH) 41 | get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") 42 | endif () 43 | # GIT_SUBMODULES_RECURSE was added in 3.17 44 | if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") 45 | FetchContent_Declare( 46 | pico_sdk 47 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 48 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 49 | GIT_SUBMODULES_RECURSE FALSE 50 | ) 51 | else () 52 | FetchContent_Declare( 53 | pico_sdk 54 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 55 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 56 | ) 57 | endif () 58 | 59 | if (NOT pico_sdk) 60 | message("Downloading Raspberry Pi Pico SDK") 61 | FetchContent_Populate(pico_sdk) 62 | set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) 63 | endif () 64 | set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) 65 | else () 66 | message(FATAL_ERROR 67 | "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." 68 | ) 69 | endif () 70 | endif () 71 | 72 | get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") 73 | if (NOT EXISTS ${PICO_SDK_PATH}) 74 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") 75 | endif () 76 | 77 | set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) 78 | if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) 79 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") 80 | endif () 81 | 82 | set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) 83 | 84 | include(${PICO_SDK_INIT_CMAKE_FILE}) 85 | -------------------------------------------------------------------------------- /blink_print_ComWokwi/pico_sdk_import.cmake: -------------------------------------------------------------------------------- 1 | # This is a copy of /external/pico_sdk_import.cmake 2 | 3 | # This can be dropped into an external project to help locate this SDK 4 | # It should be include()ed prior to project() 5 | 6 | if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) 7 | set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) 8 | message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") 9 | endif () 10 | 11 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT)) 12 | set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT}) 13 | message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')") 14 | endif () 15 | 16 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH)) 17 | set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH}) 18 | message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") 19 | endif () 20 | 21 | if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) 22 | set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) 23 | message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") 24 | endif () 25 | 26 | if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) 27 | set(PICO_SDK_FETCH_FROM_GIT_TAG "master") 28 | message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") 29 | endif() 30 | 31 | set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") 32 | set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") 33 | set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") 34 | set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") 35 | 36 | if (NOT PICO_SDK_PATH) 37 | if (PICO_SDK_FETCH_FROM_GIT) 38 | include(FetchContent) 39 | set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR}) 40 | if (PICO_SDK_FETCH_FROM_GIT_PATH) 41 | get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") 42 | endif () 43 | # GIT_SUBMODULES_RECURSE was added in 3.17 44 | if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") 45 | FetchContent_Declare( 46 | pico_sdk 47 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 48 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 49 | GIT_SUBMODULES_RECURSE FALSE 50 | ) 51 | else () 52 | FetchContent_Declare( 53 | pico_sdk 54 | GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk 55 | GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} 56 | ) 57 | endif () 58 | 59 | if (NOT pico_sdk) 60 | message("Downloading Raspberry Pi Pico SDK") 61 | FetchContent_Populate(pico_sdk) 62 | set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR}) 63 | endif () 64 | set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) 65 | else () 66 | message(FATAL_ERROR 67 | "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git." 68 | ) 69 | endif () 70 | endif () 71 | 72 | get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") 73 | if (NOT EXISTS ${PICO_SDK_PATH}) 74 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found") 75 | endif () 76 | 77 | set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake) 78 | if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE}) 79 | message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK") 80 | endif () 81 | 82 | set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE) 83 | 84 | include(${PICO_SDK_INIT_CMAKE_FILE}) 85 | -------------------------------------------------------------------------------- /ArquivosUF2/DeFabrica/BitDogLab_Original.py: -------------------------------------------------------------------------------- 1 | from machine import PWM, Pin 2 | import neopixel 3 | import time 4 | import random 5 | from machine import Pin, SoftI2C, ADC 6 | from ssd1306 import SSD1306_I2C 7 | import math 8 | 9 | # Configuração do OLED 10 | i2c = SoftI2C(scl=Pin(15), sda=Pin(14)) 11 | oled = SSD1306_I2C(128, 64, i2c) 12 | 13 | joystick_button = Pin(22, Pin.IN, Pin.PULL_UP) 14 | #______________________________________________ 15 | 16 | 17 | 18 | # Número de LEDs na sua matriz 5x5 19 | NUM_LEDS = 25 20 | 21 | # Inicializar a matriz de NeoPixels no GPIO7 22 | np = neopixel.NeoPixel(Pin(7), NUM_LEDS) 23 | 24 | # Definindo a matriz de LEDs 25 | LED_MATRIX = [ 26 | [24, 23, 22, 21, 20], 27 | [15, 16, 17, 18, 19], 28 | [14, 13, 12, 11, 10], 29 | [5, 6, 7, 8, 9], 30 | [4, 3, 2, 1, 0] 31 | ] 32 | 33 | # Inicializar ADC para os pinos VRx (GPIO26) e VRy (GPIO27) 34 | adc_vrx = ADC(Pin(26)) 35 | adc_vry = ADC(Pin(27)) 36 | 37 | def map_value(value, in_min, in_max, out_min, out_max): 38 | return (value - in_min) * (out_max - out_min) // (in_max - in_min) + out_min 39 | 40 | 41 | 42 | 43 | #_______________________________________________ 44 | def update_oled(lines): 45 | oled.fill(0) 46 | for i, line in enumerate(lines): 47 | oled.text(line, 0, i * 8) 48 | oled.show() 49 | 50 | 51 | # Configurando o LED RGB 52 | led_r = PWM(Pin(12)) 53 | led_g = PWM(Pin(13)) 54 | led_b = PWM(Pin(11)) 55 | 56 | led_r.freq(1000) 57 | led_g.freq(1000) 58 | led_b.freq(1000) 59 | 60 | # Configuração do NeoPixel 61 | NUM_LEDS = 25 62 | np = neopixel.NeoPixel(Pin(7), NUM_LEDS) 63 | 64 | # Configuração dos botões 65 | button_a = Pin(5, Pin.IN, Pin.PULL_UP) 66 | button_b = Pin(6, Pin.IN, Pin.PULL_UP) 67 | 68 | # definir cores para os LEDs 69 | RED = (50, 0, 0) 70 | GREEN = (0, 50, 0) 71 | BLUE = (0, 0, 50) 72 | YELLOW = (30, 30, 0) 73 | MAGENTA = (30, 0, 30) 74 | CYAN = (0, 30, 30) 75 | WHITE = (25, 25, 25) 76 | BLACK = (0, 0, 0) 77 | 78 | # Configuração do Buzzer 79 | buzzer1 = PWM(Pin(21)) 80 | buzzer1.freq(50) # Frequência inicial grave 81 | buzzer2 = PWM(Pin(10)) 82 | buzzer2.freq(50) # Frequência inicial grave 83 | 84 | def gradual_light_sound(duration=2): 85 | step_duration = duration / 100 86 | for i in range(101): 87 | duty_cycle = (i * 65535) // 200 # Calcular o ciclo de trabalho atual 88 | 89 | # Ajustar o LED para a intensidade atual 90 | led_r.duty_u16(duty_cycle) 91 | led_g.duty_u16(duty_cycle) 92 | led_b.duty_u16(duty_cycle) 93 | 94 | # Ajustar a frequência do buzzer 95 | buzzer1.freq(50 + i * 2) # Ajustar a frequência do buzzer 96 | 97 | # Ajustar o volume do buzzer 98 | buzzer1.duty_u16(duty_cycle // 4) # Reduzir o volume para 25% do máximo 99 | 100 | time.sleep(step_duration) 101 | 102 | # Ajustar a frequência do buzzer 103 | buzzer2.freq(50 + i * 2) # Ajustar a frequência do buzzer 104 | 105 | # Ajustar o volume do buzzer 106 | buzzer2.duty_u16(duty_cycle // 8) # Reduzir o volume para 25% do máximo 107 | 108 | time.sleep(step_duration) 109 | 110 | # Desligar o LED e o buzzer no final 111 | led_r.duty_u16(0) 112 | led_g.duty_u16(0) 113 | led_b.duty_u16(0) 114 | buzzer1.duty_u16(0) 115 | buzzer2.duty_u16(0) 116 | 117 | def beep(freq=1000, duration=0.2): 118 | ''' Toca um beep com a frequência e duração especificadas ''' 119 | buzzer1.freq(freq) 120 | buzzer1.duty_u16(5000) # Intensidade média 121 | time.sleep(duration) 122 | buzzer1.duty_u16(0) # Desliga o buzzer 123 | 124 | buzzer2.freq(freq) 125 | buzzer2.duty_u16(5000) # Intensidade média 126 | time.sleep(duration) 127 | buzzer2.duty_u16(0) # Desliga o buzzer 128 | 129 | def star_trek_beep(): 130 | #buzzer1 = PWM(Pin(21)) # Buzzer A conectado ao GPIO21 131 | 132 | # Primeiro tom 133 | buzzer1.freq(1000) 134 | buzzer1.duty_u16(40000) 135 | time.sleep(0.1) 136 | buzzer1.duty_u16(0) 137 | 138 | # Pequena pausa 139 | time.sleep(0.05) 140 | 141 | # Segundo tom 142 | buzzer1.freq(1500) 143 | buzzer1.duty_u16(40000) 144 | time.sleep(0.1) 145 | buzzer1.duty_u16(0) 146 | 147 | # Pequena pausa 148 | time.sleep(0.05) 149 | 150 | # Terceiro tom 151 | buzzer1.freq(2000) 152 | buzzer1.duty_u16(40000) 153 | time.sleep(0.1) 154 | buzzer1.duty_u16(0) 155 | 156 | # Primeiro tom 157 | buzzer2.freq(1000) 158 | buzzer2.duty_u16(40000) 159 | time.sleep(0.1) 160 | buzzer2.duty_u16(0) 161 | 162 | # Pequena pausa 163 | time.sleep(0.05) 164 | 165 | # Segundo tom 166 | buzzer2.freq(1500) 167 | buzzer2.duty_u16(40000) 168 | time.sleep(0.1) 169 | buzzer2.duty_u16(0) 170 | 171 | # Pequena pausa 172 | time.sleep(0.05) 173 | 174 | # Terceiro tom 175 | buzzer2.freq(2000) 176 | buzzer2.duty_u16(40000) 177 | time.sleep(0.1) 178 | buzzer2.duty_u16(0) 179 | 180 | def dim_leds(led_sequence, current_index): 181 | # Define o fator de diminuição de intensidade baseado no índice atual do LED 182 | dim_factor = 255 // (len(led_sequence) - current_index) 183 | for idx, led in enumerate(led_sequence): 184 | if idx < current_index: 185 | r, g, b = np[led] 186 | r = max(r - dim_factor, 0) 187 | np[led] = (r, g, b) 188 | 189 | 190 | # apagar todos os LEDs 191 | def clear_all(): 192 | for i in range(len(np)): 193 | np[i] = BLACK 194 | np.write() 195 | 196 | def heartbeat_effect(sequence): 197 | initial_delay = 0.3 # tempo inicial entre LEDs 198 | decrement = 0.05 # valor a ser decrementado a cada LED 199 | 200 | # Limpa todos os LEDs 201 | clear_all() 202 | 203 | for idx, led in enumerate(sequence): 204 | np[led] = (255, 0, 0) # Acende o LED vermelho 205 | dim_leds(sequence, idx) # Diminui o brilho dos LEDs na sequência 206 | np.write() 207 | time.sleep(initial_delay - idx * decrement) 208 | 209 | # Toca o beep no buzzer 210 | beep() 211 | 212 | # Aguarda um pouco e depois desliga todos os LEDs 213 | time.sleep(0.3) 214 | clear_all() 215 | 216 | def heart(): 217 | """Acende um coração grande na matriz de LEDs.""" 218 | # Primeiro, desligamos todos os LEDs para garantir que começa "limpo" 219 | clear_all() 220 | 221 | # Lista dos LEDs que devem ser acesos para o coração 222 | heart_leds = [2, 6, 14, 15, 23, 17, 21, 19, 10, 8] 223 | 224 | # Acendendo os LEDs em vermelho 225 | for led in heart_leds: 226 | np[led] = (255, 0, 0) # RED 227 | 228 | np.write() 229 | 230 | # Define O CÓDIGO DE ACENDER OS LEDs DO CORAÇÃO ALEATORIAMENTE 231 | def random_color(dim_factor=1): 232 | """Gera uma cor aleatória.""" 233 | return (int(random.randint(0, 255) * dim_factor), 234 | int(random.randint(0, 255) * dim_factor), 235 | int(random.randint(0, 255) * dim_factor)) 236 | 237 | #efeito de som usada na piscadinha direita 238 | def door_swish(): 239 | for freq in range(1000, 2000, 50): 240 | buzzer1.freq(freq) 241 | buzzer1.duty_u16(40000) 242 | time.sleep(0.005) 243 | for freq in range(2000, 1000, -50): 244 | buzzer1.freq(freq) 245 | buzzer1.duty_u16(40000) 246 | time.sleep(0.005) 247 | buzzer1.duty_u16(0) 248 | 249 | for freq in range(1000, 2000, 50): 250 | buzzer2.freq(freq) 251 | buzzer2.duty_u16(40000) 252 | time.sleep(0.005) 253 | for freq in range(2000, 1000, -50): 254 | buzzer2.freq(freq) 255 | buzzer2.duty_u16(40000) 256 | time.sleep(0.005) 257 | buzzer2.duty_u16(0) 258 | 259 | def l3_37_sound_and_lights(): 260 | border_heart_leds = [2, 6, 14, 15, 23, 17, 21, 19, 10, 8] 261 | inner_heart_leds = [7, 13, 12, 11, 16, 18] 262 | already_illuminated = [] 263 | 264 | for freq in [440, 392, 440, 392]: # Notas: A, G 265 | random_led = random.choice([led for led in border_heart_leds + inner_heart_leds if led not in already_illuminated]) 266 | already_illuminated.append(random_led) 267 | color_intensity = 0.5 if random_led in inner_heart_leds else 1 268 | np[random_led] = random_color(color_intensity) 269 | np.write() 270 | buzzer1.freq(freq) 271 | buzzer1.duty_u16(5000) 272 | time.sleep(0.1) 273 | buzzer2.freq(freq) 274 | buzzer2.duty_u16(5000) 275 | time.sleep(0.1) 276 | 277 | for freq in [587, 493, 587, 523]: # Notas: D, B, D, C 278 | random_led = random.choice([led for led in border_heart_leds + inner_heart_leds if led not in already_illuminated]) 279 | already_illuminated.append(random_led) 280 | color_intensity = 0.5 if random_led in inner_heart_leds else 1 281 | np[random_led] = random_color(color_intensity) 282 | np.write() 283 | buzzer1.freq(freq) 284 | buzzer1.duty_u16(5000) 285 | time.sleep(0.10) 286 | buzzer2.freq(freq) 287 | buzzer2.duty_u16(5000) 288 | time.sleep(0.10) 289 | 290 | for led in [l for l in border_heart_leds + inner_heart_leds if l not in already_illuminated]: 291 | color_intensity = 0.5 if led in inner_heart_leds else 1 292 | np[led] = random_color(color_intensity) 293 | np.write() 294 | time.sleep(0.1) 295 | 296 | buzzer1.duty_u16(0) 297 | buzzer2.duty_u16(0) 298 | 299 | def smile_face(): 300 | # Definindo a sequência de cores 301 | colors = [ 302 | BLACK, BLUE, BLUE, BLUE, BLACK, 303 | BLUE, BLACK, BLACK, BLACK, BLUE, 304 | BLACK, BLACK, BLACK, BLACK, BLACK, 305 | BLACK, CYAN, BLACK, CYAN, BLACK, 306 | BLACK, BLACK, BLACK, BLACK, BLACK 307 | ] 308 | 309 | # Atribuindo as cores à matriz np 310 | for i, color in enumerate(colors): 311 | np[i] = color 312 | 313 | np.write() 314 | 315 | def blink_right_eye(): 316 | np[0] = BLACK 317 | np[1] = BLUE 318 | np[2] = BLUE 319 | np[3] = BLUE 320 | np[4] = BLACK 321 | np[5] = BLUE 322 | np[6] = BLACK 323 | np[7] = BLACK 324 | np[8] = BLACK 325 | np[9] = BLUE 326 | np[10] = BLACK 327 | np[11] = BLACK 328 | np[12] = BLACK 329 | np[13] = BLACK 330 | np[14] = BLACK 331 | np[15] = BLACK 332 | np[16] = CYAN 333 | np[17] = BLACK 334 | np[18] = BLACK 335 | np[19] = BLACK 336 | np[20] = BLACK 337 | np[21] = BLACK 338 | np[22] = BLACK 339 | np[23] = BLACK 340 | np[24] = BLACK 341 | 342 | np.write() 343 | door_swish() 344 | 345 | # aguardar e retorna a cor azul do olho direito 346 | time.sleep(.2) 347 | np[18] = CYAN 348 | np.write() 349 | 350 | #define função de som sincronizada com o led da boca piscando 351 | def colour_mouth(): 352 | 353 | 354 | def r2d2_beep(): 355 | # Primeiro bipe 356 | buzzer1.freq(4000) 357 | buzzer1.duty_u16(30000) 358 | time.sleep(0.1) 359 | buzzer1.duty_u16(0) 360 | np[2] = RED 361 | np.write() 362 | time.sleep(0.2) 363 | 364 | # Segundo bipe 365 | buzzer1.freq(5000) 366 | buzzer1.duty_u16(30000) 367 | time.sleep(0.15) 368 | buzzer1.duty_u16(0) 369 | np[2] = CYAN 370 | np[3] = CYAN 371 | np[1] = CYAN 372 | np.write() 373 | time.sleep(0.2) 374 | 375 | # Terceiro bipe 376 | buzzer1.freq(4500) 377 | buzzer1.duty_u16(30000) 378 | time.sleep(0.12) 379 | buzzer1.duty_u16(0) 380 | np[2] = RED 381 | np[3] = RED 382 | np[1] = RED 383 | np.write() 384 | time.sleep(0.2) 385 | 386 | # Primeiro bipe 387 | buzzer2.freq(4000) 388 | buzzer2.duty_u16(30000) 389 | time.sleep(0.1) 390 | buzzer2.duty_u16(0) 391 | np[2] = RED 392 | np.write() 393 | time.sleep(0.2) 394 | 395 | # Segundo bipe 396 | buzzer2.freq(5000) 397 | buzzer2.duty_u16(30000) 398 | time.sleep(0.15) 399 | buzzer2.duty_u16(0) 400 | np[2] = CYAN 401 | np[3] = CYAN 402 | np[1] = CYAN 403 | np.write() 404 | time.sleep(0.2) 405 | 406 | # Terceiro bipe 407 | buzzer2.freq(4500) 408 | buzzer2.duty_u16(30000) 409 | time.sleep(0.12) 410 | buzzer2.duty_u16(0) 411 | np[2] = RED 412 | np[3] = RED 413 | np[1] = RED 414 | np.write() 415 | time.sleep(0.2) 416 | 417 | r2d2_beep() 418 | 419 | np[2] = BLUE 420 | np[3] = BLUE 421 | np[1] = BLUE 422 | np.write() 423 | 424 | def triple_zero_sound(): 425 | # Sequência inicial educada 426 | for freq in [440, 554, 660]: # Notas: A, C#, E 427 | buzzer1.freq(freq) 428 | buzzer1.duty_u16(5000) 429 | time.sleep(0.1) 430 | 431 | np[16] = BLACK 432 | np[18] = BLACK 433 | np.write() 434 | 435 | # Transição sinistra e abrupta 436 | for freq in range(660, 880, 5): 437 | buzzer1.freq(freq) 438 | buzzer1.duty_u16(5000) 439 | time.sleep(0.005) 440 | 441 | # Parada súbita 442 | buzzer1.freq(880) 443 | time.sleep(0.3) 444 | 445 | np[16] = CYAN 446 | np[18] = CYAN 447 | np.write() 448 | # Desliga o buzzer ao final 449 | buzzer1.duty_u16(0) 450 | 451 | # Sequência inicial educada 452 | for freq in [440, 554, 660]: # Notas: A, C#, E 453 | buzzer2.freq(freq) 454 | buzzer2.duty_u16(5000) 455 | time.sleep(0.1) 456 | 457 | np[16] = BLACK 458 | np[18] = BLACK 459 | np.write() 460 | 461 | # Transição sinistra e abrupta 462 | for freq in range(660, 880, 5): 463 | buzzer2.freq(freq) 464 | buzzer2.duty_u16(5000) 465 | time.sleep(0.005) 466 | 467 | # Parada súbita 468 | buzzer2.freq(880) 469 | time.sleep(0.3) 470 | 471 | np[16] = CYAN 472 | np[18] = CYAN 473 | np.write() 474 | # Desliga o buzzer ao final 475 | buzzer2.duty_u16(0) 476 | 477 | def seta_Direita(): 478 | np[0] = BLACK 479 | np[1] = BLACK 480 | np[2] = YELLOW 481 | np[3] = BLACK 482 | np[4] = BLACK 483 | np[5] = BLACK 484 | np[6] = BLACK 485 | np[7] = BLACK 486 | np[8] = YELLOW 487 | np[9] = BLACK 488 | np[10] = YELLOW 489 | np[11] = YELLOW 490 | np[12] = YELLOW 491 | np[13] = YELLOW 492 | np[14] = YELLOW 493 | np[15] = BLACK 494 | np[16] = BLACK 495 | np[17] = BLACK 496 | np[18] = YELLOW 497 | np[19] = BLACK 498 | np[20] = BLACK 499 | np[21] = BLACK 500 | np[22] = YELLOW 501 | np[23] = BLACK 502 | np[24] = BLACK 503 | np.write() 504 | # Desliga o buzzer ao final 505 | buzzer1.duty_u16(0) 506 | buzzer2.duty_u16(0) 507 | 508 | 509 | def seta_Esquerda(): 510 | np[0] = BLACK 511 | np[1] = BLACK 512 | np[2] = YELLOW 513 | np[3] = BLACK 514 | np[4] = BLACK 515 | np[5] = BLACK 516 | np[6] = YELLOW 517 | np[7] = BLACK 518 | np[8] = BLACK 519 | np[9] = BLACK 520 | np[10] = YELLOW 521 | np[11] = YELLOW 522 | np[12] = YELLOW 523 | np[13] = YELLOW 524 | np[14] = YELLOW 525 | np[15] = BLACK 526 | np[16] = YELLOW 527 | np[17] = BLACK 528 | np[18] = BLACK 529 | np[19] = BLACK 530 | np[20] = BLACK 531 | np[21] = BLACK 532 | np[22] = YELLOW 533 | np[23] = BLACK 534 | np[24] = BLACK 535 | np.write() 536 | # Desliga o buzzer ao final 537 | buzzer1.duty_u16(0) 538 | buzzer2.duty_u16(0) 539 | 540 | 541 | def xplosion(): 542 | # Definindo a sequência de cores 543 | colors = [ 544 | BLACK, BLACK, BLACK, BLACK, BLACK, 545 | BLACK, BLACK, BLACK, BLACK, BLACK, 546 | BLACK, BLACK, RED, BLACK, BLACK, 547 | BLACK, BLACK, BLACK, BLACK, BLACK, 548 | BLACK, BLACK, BLACK, BLACK, BLACK 549 | ] 550 | 551 | # Atribuindo as cores à matriz np 552 | for i, color in enumerate(colors): 553 | np[i] = color 554 | 555 | np.write() 556 | 557 | time.sleep(.1) 558 | 559 | # Som forte e abrupto 560 | for freq in range(2000, 50, -50): 561 | buzzer1.freq(freq) 562 | buzzer1.duty_u16(32767) # 50% de duty cycle 563 | time.sleep(0.005) 564 | 565 | for freq in range(2000, 50, -50): 566 | buzzer2.freq(freq) 567 | buzzer2.duty_u16(32767) # 50% de duty cycle 568 | time.sleep(0.005) 569 | 570 | colors = [ 571 | BLACK, BLACK, BLACK, BLACK, BLACK, 572 | BLACK, BLACK, RED, BLACK, BLACK, 573 | BLACK, RED, BLUE, RED, BLACK, 574 | BLACK, BLACK, RED, BLACK, BLACK, 575 | BLACK, BLACK, BLACK, BLACK, BLACK 576 | ] 577 | 578 | # Atribuindo as cores à matriz np 579 | for i, color in enumerate(colors): 580 | np[i] = color 581 | 582 | np.write() 583 | 584 | time.sleep(.2) 585 | 586 | 587 | colors = [ 588 | BLACK, BLACK, RED, BLACK, BLACK, 589 | BLACK, RED, BLUE, RED, BLACK, 590 | RED, BLUE, WHITE, BLUE, RED, 591 | BLACK, RED, BLUE, RED, BLACK, 592 | BLACK, BLACK, RED, BLACK, BLACK 593 | ] 594 | 595 | # Atribuindo as cores à matriz np 596 | for i, color in enumerate(colors): 597 | np[i] = color 598 | 599 | np.write() 600 | 601 | time.sleep(.2) 602 | 603 | colors = [ 604 | BLACK, RED, RED, RED, BLACK, 605 | RED, BLUE, WHITE, BLUE, RED, 606 | RED, WHITE, WHITE, WHITE, RED, 607 | RED, BLUE, WHITE, BLUE, RED, 608 | BLACK, RED, RED, RED, BLACK 609 | ] 610 | 611 | # Atribuindo as cores à matriz np 612 | for i, color in enumerate(colors): 613 | np[i] = color 614 | 615 | np.write() 616 | 617 | time.sleep(.2) 618 | 619 | colors = [ 620 | BLACK, WHITE, WHITE, WHITE, BLACK, 621 | WHITE, WHITE, WHITE, WHITE, WHITE, 622 | WHITE, WHITE, BLACK, WHITE, WHITE, 623 | WHITE, WHITE, WHITE, WHITE, WHITE, 624 | BLACK, WHITE, WHITE, WHITE, BLACK 625 | ] 626 | 627 | # Atribuindo as cores à matriz np 628 | for i, color in enumerate(colors): 629 | np[i] = color 630 | 631 | np.write() 632 | 633 | 634 | time.sleep(.1) 635 | 636 | colors = [ 637 | BLACK, WHITE, WHITE, WHITE, BLACK, 638 | WHITE, BLACK, BLACK, BLACK, WHITE, 639 | WHITE, BLACK, BLACK, BLACK, WHITE, 640 | WHITE, BLACK, BLACK, BLACK, WHITE,'' 641 | BLACK, WHITE, WHITE, WHITE, BLACK 642 | ] 643 | 644 | # Atribuindo as cores à matriz np 645 | for i, color in enumerate(colors): 646 | np[i] = color 647 | 648 | np.write() 649 | 650 | time.sleep(.2) 651 | 652 | colors = [ 653 | BLACK, WHITE, BLACK, WHITE, BLACK, 654 | WHITE, BLACK, BLACK, BLACK, WHITE, 655 | BLACK, BLACK, BLACK, BLACK, BLACK, 656 | WHITE, BLACK, BLACK, BLACK, WHITE, 657 | BLACK, WHITE, BLACK, WHITE, BLACK 658 | ] 659 | 660 | # Atribuindo as cores à matriz np 661 | for i, color in enumerate(colors): 662 | np[i] = color 663 | 664 | np.write() 665 | 666 | 667 | clear_all() 668 | time.sleep(.2) 669 | 670 | colors = [ 671 | BLACK, WHITE, BLACK, WHITE, BLACK, 672 | WHITE, BLACK, BLACK, BLACK, WHITE, 673 | BLACK, BLACK, BLACK, BLACK, BLACK, 674 | WHITE, BLACK, BLACK, BLACK, WHITE, 675 | BLACK, WHITE, BLACK, WHITE, BLACK 676 | ] 677 | 678 | # Atribuindo as cores à matriz np 679 | for i, color in enumerate(colors): 680 | np[i] = color 681 | 682 | np.write() 683 | 684 | # Reverberações ou ecos mais suaves 685 | for _ in range(5): 686 | buzzer1.duty_u16(16383) # 25% de duty cycle 687 | time.sleep(0.1) 688 | buzzer1.duty_u16(0) # Desliga 689 | time.sleep(0.1) 690 | 691 | buzzer1.duty_u16(0) # Certifique-se de que o buzzer esteja desligado 692 | 693 | # Reverberações ou ecos mais suaves 694 | for _ in range(5): 695 | buzzer2.duty_u16(16383) # 25% de duty cycle 696 | time.sleep(0.1) 697 | buzzer2.duty_u16(0) # Desliga 698 | time.sleep(0.1) 699 | 700 | buzzer2.duty_u16(0) # Certifique-se de que o buzzer esteja desligado 701 | 702 | # Inicialização do Neopixel e ADC para o microfone 703 | #np = neopixel.NeoPixel(machine.Pin(PIN_NUM), NUM_LEDS) 704 | adc = machine.ADC(machine.Pin(28)) # GP28 para o microfone 705 | 706 | OFFSET = int(1.65 / 3.3 * 65536) # Valor ADC correspondente a 1,65V 707 | 708 | # Definição dos patamares 709 | patamares = [ 710 | [2], 711 | [1, 2, 3], 712 | [7, 1, 2, 3], 713 | [12, 6, 7, 8, 0, 1, 2, 3, 4], 714 | [12, 6, 7, 8, 0, 1, 2, 3, 4, 11, 13, 17, 5, 9], 715 | [12, 6, 7, 8, 0, 1, 2, 3, 4, 11, 13, 17, 5, 9, 22, 16, 18, 10, 14], 716 | [12, 6, 7, 8, 0, 1, 2, 3, 4, 11, 13, 17, 5, 9, 22, 16, 18, 10, 14, 15, 19], 717 | [12, 6, 7, 8, 0, 1, 2, 3, 4, 11, 13, 17, 5, 9, 22, 16, 18, 10, 14, 15, 19, 20, 21, 23, 24] 718 | ] * 2 719 | 720 | def determinar_cor(patamar_index): 721 | if patamar_index < len(patamares) / 3.5: 722 | return (0, 0, 85) # Azul 723 | else: 724 | return (105, 0, 0) # Vermelho 725 | 726 | def acender_leds(patamar_index): 727 | cor = determinar_cor(patamar_index) 728 | 729 | # Primeiro, desligamos todos os LEDs 730 | for i in range(NUM_LEDS): 731 | np[i] = (0, 0, 0) 732 | 733 | # Depois, acendemos os LEDs do patamar atual 734 | for i in patamares[patamar_index]: 735 | np[i] = cor 736 | 737 | np.write() 738 | 739 | def acender_por_valor(ratio): 740 | max_patamares = len(patamares) 741 | patamar_index = int(ratio * max_patamares) 742 | patamar_index = min(patamar_index, max_patamares - 1) # Evitar índices fora da faixa 743 | 744 | # Se o ratio estiver abaixo de um limiar, desliga todos os LEDs 745 | if ratio < 0.05: 746 | for i in range(NUM_LEDS): 747 | np[i] = (0, 0, 0) 748 | np.write() 749 | else: 750 | acender_leds(patamar_index) 751 | 752 | 753 | def vu_meter(adc_value): 754 | volume = max(0, (adc_value - OFFSET)*2) # Subtrai o offset e garante que o valor seja positivo 755 | volume_ratio = volume / 65536.0 756 | normalized_ratio = math.pow(volume_ratio, 0.5) # Ajustando a sensibilidade 757 | 758 | acender_por_valor(normalized_ratio) 759 | 760 | 761 | 762 | #------------------------ 763 | clear_all() 764 | # Chamar a função 765 | gradual_light_sound() 766 | 767 | # Sequência de LEDs para simular o pulso cardíaco 768 | sequence = [14, 6, 12, 17, 21, 10] 769 | 770 | # Especifica o número de repetições desejado 771 | num_repetitions = 3 772 | for _ in range(num_repetitions): 773 | heartbeat_effect(sequence) 774 | # Exibe o coração grande 775 | heart() 776 | time.sleep(0.2) 777 | 778 | l3_37_sound_and_lights() 779 | time.sleep(1.5) 780 | 781 | 782 | #update_oled("OLA HUMANO!") 783 | messages = [ 784 | " ", 785 | " ", 786 | " OLA HUMANO!", 787 | " " 788 | " ", 789 | " ", 790 | " ", 791 | " " 792 | ] 793 | update_oled(messages) 794 | 795 | 796 | # Primeiro, desligamos todos os LEDs para garantir que começa "limpo" 797 | clear_all() 798 | time.sleep(1.5) 799 | 800 | smile_face() 801 | time.sleep(1) 802 | 803 | blink_right_eye() 804 | time.sleep(1) 805 | 806 | colour_mouth() 807 | time.sleep(2.2) 808 | 809 | triple_zero_sound() 810 | time.sleep(2) 811 | 812 | clear_all() 813 | 814 | 815 | # Defina as cores que você deseja alternar 816 | cores = [(255, 0, 0), (0, 255, 0), (0, 0, 255)] # vermelho, verde, azul 817 | indice_cor = 0 # Índice da cor atual na lista de cores 818 | 819 | while True: 820 | # Primeira parte: Seta esquerda e espera pelo botão A 821 | seta_Esquerda() 822 | time.sleep(.5) 823 | clear_all() 824 | time.sleep(.2) 825 | seta_Esquerda() 826 | time.sleep(.3) 827 | clear_all() 828 | time.sleep(.3) 829 | seta_Esquerda() 830 | 831 | 832 | 833 | messages = [ 834 | " ", 835 | " ", 836 | " APERTE ", 837 | " ", 838 | " A ", 839 | " ", 840 | " ", 841 | " " 842 | ] 843 | update_oled(messages) 844 | 845 | # Aguarde até o Botão A ser pressionado 846 | while button_a.value(): 847 | time.sleep(0.1) # Adicione um delay para debounce 848 | 849 | clear_all() 850 | xplosion() 851 | 852 | # Segunda parte: Seta direita e espera pelo botão B 853 | seta_Direita() 854 | time.sleep(.5) 855 | clear_all() 856 | time.sleep(.2) 857 | seta_Direita() 858 | time.sleep(.3) 859 | clear_all() 860 | time.sleep(.3) 861 | seta_Direita() 862 | 863 | 864 | messages = [ 865 | " ", 866 | " ", 867 | " APERTE ", 868 | " ", 869 | " B ", 870 | " ", 871 | " ", 872 | " " 873 | ] 874 | update_oled(messages) 875 | 876 | # Aguarde até o Botão B ser pressionado 877 | while button_b.value(): 878 | time.sleep(0.1) # Adicione um delay para debounce 879 | 880 | clear_all() 881 | xplosion() 882 | 883 | update_oled(" ") 884 | update_oled("Mova Joystick") 885 | 886 | messages = [ 887 | " ", 888 | " Mova Joystick ", 889 | " ", 890 | " ", 891 | " ", 892 | " ", 893 | " ", 894 | " ", 895 | ] 896 | update_oled(messages) 897 | 898 | time.sleep(1) 899 | colors = [ 900 | GREEN, GREEN, GREEN, GREEN, BLACK, 901 | BLACK, GREEN, GREEN, BLACK, BLACK, 902 | BLACK, BLACK, GREEN, GREEN, BLACK, 903 | BLACK, GREEN, BLACK, GREEN, BLACK, 904 | GREEN, BLACK, BLACK, GREEN, BLACK 905 | ] 906 | 907 | 908 | # Atribuindo as cores à matriz np 909 | for i, color in enumerate(colors): 910 | np[i] = color 911 | 912 | np.write() 913 | time.sleep(2) 914 | 915 | 916 | messages = [ 917 | " ", 918 | " Mova Joystick ", 919 | " ", 920 | " ", 921 | " ", 922 | " ", 923 | " ", 924 | " ", 925 | ] 926 | update_oled(messages) 927 | 928 | # Agora entre no modo de controle do joystick 929 | while True: 930 | vrx_value = adc_vrx.read_u16() 931 | vry_value = adc_vry.read_u16() 932 | 933 | messages = [ 934 | " ", 935 | " ", 936 | " APERTE ", 937 | " ", 938 | " B ", 939 | " para ", 940 | " ", 941 | " SAIR ", 942 | ] 943 | update_oled(messages) 944 | 945 | offsetx = 0 946 | offsety = 400 947 | row = map_value(vrx_value - offsetx, 240, 65279, 0, 4) 948 | col = map_value(vry_value - offsety, 65278, 240, 0, 4) 949 | 950 | for i in range(NUM_LEDS): 951 | np[i] = (0, 0, 0) 952 | 953 | led_index = LED_MATRIX[row][col] 954 | #beep(50, 4000) # Toca um beep rápido 955 | np[led_index] = cores[indice_cor] # Use a cor atual 956 | np.write() 957 | 958 | # Verifica se o botão do joystick está pressionado 959 | if not joystick_button.value(): 960 | indice_cor = (indice_cor + 1) % len(cores) # Atualiza o índice da cor 961 | star_trek_beep() 962 | print("Botão do joystick pressionado. Mudando a cor.") 963 | 964 | # Verifica se o botão B está pressionado 965 | if not button_b.value(): 966 | print("Botão B pressionado. Saindo do modo de controle do joystick.") 967 | update_oled(" ") 968 | break # Sai do loop se o botão B estiver pressionado 969 | 970 | time.sleep(0.1) 971 | 972 | 973 | 974 | 975 | 976 | # Aguarde até que o botão B seja liberado 977 | while not button_b.value(): 978 | time.sleep(0.1) 979 | 980 | update_oled(" ") 981 | update_oled("Escutando") 982 | 983 | messages = [ 984 | " Escutando ", 985 | " ", 986 | " APERTE ", 987 | " ", 988 | " B ", 989 | " para ", 990 | " ", 991 | " SAIR ", 992 | ] 993 | update_oled(messages) 994 | 995 | 996 | 997 | # Modo VU Meter 998 | while True: 999 | if button_b.value(): 1000 | adc_value = adc.read_u16() # Lendo o valor do ADC do microfone 1001 | vu_meter(adc_value) # Atualizando o VU meter com base no valor do ADC 1002 | time.sleep(0.02) # Um pequeno atraso para tornar o loop manejável 1003 | else: 1004 | print("Botão B pressionado. Saindo do modo VU Meter.") 1005 | break # Sai do loop se o botão B estiver pressionado 1006 | update_oled(" ") 1007 | update_oled(" OLA EHUMANO") 1008 | 1009 | messages = [ 1010 | " ", 1011 | " ", 1012 | " OLA EHUMANO ", 1013 | " ", 1014 | " ", 1015 | " ", 1016 | " ", 1017 | " ", 1018 | ] 1019 | update_oled(messages) 1020 | 1021 | 1022 | 1023 | time.sleep(0.1) --------------------------------------------------------------------------------