forked from wokwi/pico-sdk-blink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new files and update existing files
- Loading branch information
1 parent
e5122ad
commit 1750ec4
Showing
32 changed files
with
577 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,17 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/mwinters-stuff/vscode-devcontainer-raspberrypi-pico | ||
{ | ||
"name": "C++ Raspberry Pi Pico", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "/usr/bin/bash" | ||
} | ||
"image": "rafaelcorsi/wokwi", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"marus25.cortex-debug", | ||
"ms-vscode.cmake-tools", | ||
"twxs.cmake", | ||
"eamodio.gitlens", | ||
"xaver.clang-format", | ||
"chris-hock.pioasm", | ||
"Wokwi.wokwi-vscode" | ||
] | ||
} | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"marus25.cortex-debug", | ||
"ms-vscode.cmake-tools", | ||
"twxs.cmake", | ||
"eamodio.gitlens", | ||
"xaver.clang-format", | ||
"chris-hock.pioasm", | ||
"Wokwi.wokwi-vscode" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "gcc -v", | ||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,2 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
desktop.init | ||
atividade-*/build/** | ||
.vscode/.cortex-debug.* | ||
/build | ||
*/test/chip/*.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"files.associations": { | ||
"wokwi-api.h": "c" | ||
}, | ||
"cmake.configureOnOpen": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Generated Cmake Pico project file | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
# initalize pico_sdk from installed location | ||
# (note this can come from environment, CMake cache etc) | ||
# set(PICO_SDK_PATH "/home/mathew/src/pico/pico-sdk") | ||
|
||
# Pull in Raspberry Pi Pico SDK (must be before project) | ||
include(pico_sdk_import.cmake) | ||
|
||
project(Proj C CXX ASM) | ||
|
||
set(PICO_CXX_ENABLE_EXCEPTIONS 1) | ||
|
||
# Initialise the Raspberry Pi Pico SDK | ||
pico_sdk_init() | ||
|
||
# # Add executable. Default name is the project name, version 0.1 | ||
|
||
# add_executable(main src/main.cpp) | ||
|
||
# pico_set_program_name(main "MAIN") | ||
# pico_set_program_version(main "0.1") | ||
|
||
# pico_enable_stdio_uart(main 1) | ||
# pico_enable_stdio_usb(main 0) | ||
|
||
# # Add the standard library to the build | ||
# target_link_libraries(main pico_stdlib) | ||
|
||
# # Add any user requested libraries | ||
# target_link_libraries(main hardware_clocks) | ||
|
||
# pico_add_extra_outputs(main) | ||
|
||
include(chip_sdk_import.cmake) | ||
|
||
add_subdirectory(atividade-1) | ||
add_subdirectory(atividade-2) | ||
add_subdirectory(atividade-3) | ||
add_subdirectory(atividade-4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,18 @@ | ||
# Generated Cmake Pico project file | ||
project(atividade-1 C CXX ASM) | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
add_executable(atividade-1 ${CMAKE_SOURCE_DIR}/atividade-1/src/main.c) | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 17) | ||
pico_set_program_name(atividade-1 "MAIN") | ||
pico_set_program_version(atividade-1 "0.1") | ||
|
||
# initalize pico_sdk from installed location | ||
# (note this can come from environment, CMake cache etc) | ||
# set(PICO_SDK_PATH "/home/mathew/src/pico/pico-sdk") | ||
|
||
# Pull in Raspberry Pi Pico SDK (must be before project) | ||
include(pico_sdk_import.cmake) | ||
|
||
project(Blink C CXX ASM) | ||
|
||
set(PICO_CXX_ENABLE_EXCEPTIONS 1) | ||
|
||
# Initialise the Raspberry Pi Pico SDK | ||
pico_sdk_init() | ||
|
||
# Add executable. Default name is the project name, version 0.1 | ||
|
||
add_executable(main src/main.cpp ) | ||
|
||
pico_set_program_name(main "MAIN") | ||
pico_set_program_version(main "0.1") | ||
|
||
pico_enable_stdio_uart(main 1) | ||
pico_enable_stdio_usb(main 0) | ||
pico_enable_stdio_uart(atividade-1 1) | ||
pico_enable_stdio_usb(atividade-1 0) | ||
|
||
# Add the standard library to the build | ||
target_link_libraries(main pico_stdlib) | ||
target_link_libraries(atividade-1 pico_stdlib) | ||
|
||
# Add any user requested libraries | ||
target_link_libraries(main | ||
hardware_clocks | ||
) | ||
|
||
pico_add_extra_outputs(main) | ||
target_link_libraries(atividade-1 hardware_clocks) | ||
|
||
pico_add_extra_outputs(atividade-1) | ||
load_chips(atividade-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Atividade 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdio.h> | ||
#include "pico/stdlib.h" | ||
|
||
const uint LED_PIN = 16; | ||
const uint BUTTON_PIN = 17; | ||
|
||
int main() { | ||
stdio_init_all(); | ||
|
||
// Configuração dos pinos | ||
gpio_init(LED_PIN); | ||
gpio_set_dir(LED_PIN, GPIO_OUT); | ||
|
||
gpio_init(BUTTON_PIN); | ||
gpio_set_dir(BUTTON_PIN, GPIO_IN); | ||
gpio_pull_down(BUTTON_PIN); | ||
|
||
while (true) { | ||
if (gpio_get(BUTTON_PIN) == 1) { | ||
// Inverte o estado do LED | ||
gpio_put(LED_PIN, 1); | ||
sleep_ms(250); | ||
} else { | ||
gpio_put(LED_PIN, 0); | ||
sleep_ms(250); | ||
} | ||
} | ||
|
||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.