Skip to content

Instantly share code, notes, and snippets.

View samneggs's full-sized avatar

Sam samneggs

View GitHub Profile
@samneggs
samneggs / boulderdash.py
Last active December 25, 2024 15:40
Boulder Dash on Pi Pico 2 in MicroPython
# Boulder Dash Pico2
from st7796 import LCD_3inch5
from gfx import Gfx
from machine import Pin, PWM, SPI
from uctypes import addressof
from time import sleep, sleep_ms, ticks_us, ticks_diff, ticks_ms
import gc, array, re, _thread
from random import randint, random
@samneggs
samneggs / st7796.py
Created November 29, 2024 20:55
Pi Pico 2 st7796 double buffer, double pixel display driver
from machine import Pin,SPI,PWM, freq, I2C
import framebuf
import time
from time import sleep_ms
import os
'''
GP2 CLK
GP3 DIN
GP5 CS x
@samneggs
samneggs / Julia2350.py
Created September 14, 2024 06:34
Mandelbrot, Julia and Metaballs Assembly Routines for the RP2350
# template
from lcd_1_8 import LCD_1inch8
import machine, math
from machine import Pin, PWM, SPI
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms
import gc, _thread, array
from micropython import const
from random import randint
from math import sin,cos,tan,radians,sqrt
@samneggs
samneggs / minesweeper.py
Created April 20, 2024 04:20
Minesweeper Game in MicroPython on Pi Pico
# minesweeper
from lcd_1_8 import LCD_1inch8
import machine
from machine import Pin, PWM
from time import sleep, ticks_us, ticks_diff, ticks_ms
import gc, array
from sys import exit
from micropython import const
from random import randint
@samneggs
samneggs / bubble_darts.py
Created April 20, 2024 04:08
Balloon Pop Game in MicroPython on Pi Pico
# Bubble Darts
from lcd_1_8 import LCD_1inch8
import machine
from machine import Pin, PWM
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms, sleep_ms
import gc, _thread, array
from sys import exit
from micropython import const
from random import randint
@samneggs
samneggs / snake_asm.py
Created April 20, 2024 03:36
Classic Snake Game In Assembly on Pi Pico
# snake_asm
from lcd_1_8 import LCD_1inch8
import machine, math
from machine import Pin, PWM
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms
import gc, _thread, array
from sys import exit
from micropython import const
from random import randint
@samneggs
samneggs / invaders_sound.py
Created November 18, 2023 21:42
Space Invaders game on Pi Pico in MicroPython
from time import sleep, ticks_us, ticks_diff, ticks_ms, sleep_ms
import gc
import _thread, array
from machine import Timer, Pin, PWM
from sys import exit
class Game_Sound:
def __init__(self):
# index,start,dur,pause,number, volume
@samneggs
samneggs / plasma.py
Created September 8, 2023 04:02
Plasma Effect in MicroPython and Assembly
# plasma
from lcd_1_8 import LCD_1inch8
import machine
from machine import Pin, PWM
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms
import gc, _thread, array
from sys import exit
from micropython import const
from random import randint
@samneggs
samneggs / astro3.py
Created August 29, 2023 23:41
Astro Miner game on PI Pico in MicroPython
# AstroMiner
from lcd_1_8 import LCD_1inch8
import machine
from machine import Pin, PWM
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms, sleep_ms
import gc, _thread, array
from sys import exit
from micropython import const
from random import randint
@samneggs
samneggs / tetris.py
Created July 2, 2023 23:00
Tetris on PI Pico in MicroPython
# Tetris
import tetris_title
from lcd_1_8 import LCD_1inch8
import machine
from machine import Pin, PWM, Timer
from uctypes import addressof
from time import sleep, ticks_us, ticks_diff, ticks_ms
import gc, _thread, array