46 lines
1.0 KiB
Python
46 lines
1.0 KiB
Python
import os
|
|
import utils.govee as govee
|
|
from enum import Enum
|
|
from pathlib import Path
|
|
from rgbmatrix import RGBMatrix, RGBMatrixOptions, graphics
|
|
from dotenv import load_dotenv
|
|
|
|
# modes
|
|
import modes.score_mode as score_mode
|
|
|
|
# --- Load environment vars ---
|
|
load_dotenv()
|
|
|
|
# --- Matrix config ---
|
|
options = RGBMatrixOptions()
|
|
options.rows = 32
|
|
options.cols = 64
|
|
options.chain_length = 4
|
|
options.parallel = 1
|
|
options.hardware_mapping = "regular"
|
|
options.gpio_slowdown = 5
|
|
options.disable_hardware_pulsing = True
|
|
options.brightness = 80
|
|
|
|
matrix = RGBMatrix(options=options)
|
|
canvas = matrix.CreateFrameCanvas()
|
|
|
|
# --- Govee API ---
|
|
if os.environ['GOVEE_API_KEY']:
|
|
govee_api = govee.GoveeApi(key=os.environ["GOVEE_API_KEY"])
|
|
|
|
# --- PyGame Audio ---
|
|
# pygame.mixer.init()
|
|
# def play_audio(filename):
|
|
# pygame.mixer.music.load(os.path.join(ASSET_DIR, filename))
|
|
# pygame.mixer.music.play()
|
|
|
|
# --- Main loop ---
|
|
def run():
|
|
global canvas
|
|
|
|
score_mode.run_board(canvas, matrix)
|
|
|
|
if __name__ == "__main__":
|
|
run()
|