This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
version=3 | |
echo "Hello world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.12) | |
include(pico_sdk_import.cmake) | |
set(CMAKE_C_STANDARD 11) | |
set(CMAKE_CXX_STANDARD 17) | |
pico_sdk_init() | |
project(test) | |
add_executable(test blink.c) | |
# Pull in our pico_stdlib which pulls in commonly used features | |
target_link_libraries(blink pico_stdlib) | |
# create map/bin/hex file etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a copy of /external/pico_sdk_import.cmake | |
# This can be dropped into an external project to help locate this SDK | |
# It should be include()ed prior to project() | |
# todo document | |
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH)) | |
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH}) | |
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pico/stdlib.h" | |
int main() { | |
const uint LED_PIN = 25; | |
gpio_init(LED_PIN); | |
gpio_set_dir(LED_PIN, GPIO_OUT); | |
while (true) { | |
gpio_put(LED_PIN, 1); | |
sleep_ms(250); | |
gpio_put(LED_PIN, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pwm = PWM(Pin(25)) | |
pwm.freq(100) | |
while True: | |
for duty in range(65025): | |
pwm.duty_u16(duty) | |
sleep(0.0001) | |
for duty in range(65025, 0, -1): | |
pwm.duty_u16(duty) | |
sleep(0.0001) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin | |
from time import sleep | |
led = Pin(25,Pin.OUT) | |
while True: | |
led.toggle() | |
sleep(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Hello world") | |
print("Welcome to GitGyan") |