Skip to content

Instantly share code, notes, and snippets.

View samneggs's full-sized avatar

Sam samneggs

View GitHub Profile
@samneggs
samneggs / Space Invaders for Pico2.py
Last active October 29, 2025 08:59
Space Invaders game on Pi Pico in MicroPython
# Space Invaders
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 / 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
@samneggs
samneggs / Centipede.py
Created June 28, 2023 14:31
Centipede game on PI Pico in MicroPython
# Centipede
import centi_splash
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
@samneggs
samneggs / LCD_3inch5.py
Created June 8, 2023 21:28
LCD 3.5 inch driver
from machine import Pin,SPI,PWM,mem32,freq
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us
from micropython import const,heap_lock
import ustruct,gc
from random import randint
from usys import exit
LCD_DC = const(8)
LCD_CS = const(9)
@samneggs
samneggs / breakout_3_5.py
Last active June 8, 2023 21:27
Breakout game on 3.5" display in MicroPython
from LCD_3inch5 import LCD_3inch5
import framebuf, gc, _thread
from micropython import const
from machine import Timer, UART, Pin
#constants
BRICK_WIDTH = const(20)
BRICK_HEIGHT = const(10)
BALL_SIZE = const(5)
BALL_X_START = const(390)
@samneggs
samneggs / starcastle.py
Created April 16, 2023 02:30
StarCastle game on Pi Pico in MicroPython
# Star Castle
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 / artillery.py
Created March 28, 2023 23:09
Artillery Game on Pi Pico in MicroPython
#Artillery
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 / hill_climb.py
Created March 28, 2023 23:06
Hill Climb Racer on Pi Pico in MicroPython
# Hill Climb
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, framebuf
from sys import exit
from micropython import const
from random import randint