Skip to content

Instantly share code, notes, and snippets.

View samneggs's full-sized avatar

Sam samneggs

View GitHub Profile
@samneggs
samneggs / raycast.py
Created January 30, 2022 23:34
Raycaster with assembly routines
#------------------------YouTube-3DSage----------------------------------------
#Full video: https://youtu.be/PC1RaETIx3Y
from raycast_maps import All_Textures,mapW,mapF,mapC
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
@samneggs
samneggs / doom_fire.py
Created February 11, 2022 05:29
Doom Fire in Assembly (mostly)
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
from usys import exit
import gc
from math import sin,cos,pi,radians,sqrt,tan
from random import randint
@samneggs
samneggs / raycast5.py
Last active February 13, 2022 06:30
Fixed fire texture, floor shading works
#----------------Based on YouTube-3DSage----------------------------------------
#Full video: https://youtu.be/PC1RaETIx3Y
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
from usys import exit
import gc
#----------------Based on YouTube-3DSage----------------------------------------
#Full video: https://youtu.be/PC1RaETIx3Y
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
from usys import exit
import gc
@samneggs
samneggs / raycast7.py
Created February 14, 2022 04:17
Fixed floor bug, fire stability and shading works
#----------------Based on YouTube-3DSage----------------------------------------
#Full video: https://youtu.be/PC1RaETIx3Y
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
from usys import exit
import gc
@samneggs
samneggs / asteroids_threaded.py
Created March 3, 2022 04:44
Asteroids on Pi Pico
from LCD_1inch14 import LCD_1inch14
from machine import Timer, reset, WDT,PWM,Pin
from math import sin,cos,radians
#import sys #uselect
from random import randint
from sys import exit
import _thread, array
import gc
#import micropython
@samneggs
samneggs / LCD_1inch14.py
Created March 5, 2022 05:04
Asteroids game using PI Pico and WaveShare LCD 1.14 v2
from machine import Pin,SPI,PWM
import framebuf
import time
BL = 13
DC = 8
RST = 12
MOSI = 11
SCK = 10
CS = 9
@samneggs
samneggs / pallet16.py
Created April 13, 2022 01:23
16 color pallet to RGB565 on Pi Pico in MicroPython and inline assembly
import gc9a01
from machine import Pin, SPI, PWM, WDT
from math import sin,cos,radians
import array, micropython, framebuf
import _thread, gc
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from sys import exit
from uctypes import addressof
MAXSCREEN_X=const(240)
@samneggs
samneggs / Lander_1bp.py
Created April 14, 2022 16:49
Luner Lander using 1 bit plane on Pi Pico.
#Lunar Lander 1 bit plane
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from micropython import const
import array
from usys import exit
from math import sin,cos,pi,radians,tan, degrees, atan2
@samneggs
samneggs / ski_game.py
Created May 9, 2022 01:33
Skiing game on Pi Pico in inline assembly with gc9a01 display
import gc9a01
from machine import Pin, SPI, PWM, WDT
import framebuf
from usys import exit
import _thread
import array, gc
from time import sleep_ms, sleep_us, ticks_diff, ticks_us, sleep
from uctypes import addressof
from micropython import const