Skip to content

Instantly share code, notes, and snippets.

View tm-sanjay's full-sized avatar
🎯
Focusing

Sanjay TM tm-sanjay

🎯
Focusing
View GitHub Profile
@tm-sanjay
tm-sanjay / test1.sh
Last active December 21, 2022 06:31
#!/bin/bash
version=3
echo "Hello world"
@tm-sanjay
tm-sanjay / CMakeList.txt
Created August 21, 2021 11:38
Pi pico with C/C++ CMakeList.txt
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.
@tm-sanjay
tm-sanjay / pico_sdk_import.cmake
Created August 21, 2021 11:35
pi pico with c/c++ pico_sdk_import.cmake
# 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}')")
@tm-sanjay
tm-sanjay / blink.c
Created August 21, 2021 11:30
pi pico Blink led (c/c++)
@tm-sanjay
tm-sanjay / led_brightness.py
Last active August 21, 2021 11:32
PWM (LED brightness) using pi pico (Python)
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)
@tm-sanjay
tm-sanjay / blink_led.py
Last active August 21, 2021 11:33
program to blink led using pi pico (pyhon)
@tm-sanjay
tm-sanjay / hello_world.py
Last active August 21, 2021 11:33
pi pico hello world(python)
print("Hello world")
print("Welcome to GitGyan")