User:Bloemist/Lumos

From HSG Wiki
< User:Bloemist
Revision as of 11:21, 4 May 2022 by Bloemist (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Import Libraries[edit]

import lumos # Lumos > functionality to send output to a screen

import lumosc # Lumos Controllers > read controller input

import lumosf # Lumos Functions > process management


Lumos[edit]

Lumos Controllers[edit]

lumosc.controllers -> a python dictionary containing all info about the controllers



Example of contents:

controllers['NORTH'] = {'NAME':'NORTH', 'ALIVE': '0','A': 0, 'B': 0, 'X':0, 'Y':0, 'LL':0, 'RR':0, 'SELECT':0, 'START':0, 'UP':0, 'DOWN':0, 'LEFT':0, 'RIGHT':0}

controllers['SOUTH'] = {'NAME':'SOUTH', 'ALIVE': '0','A': 0, 'B': 0, 'X':0, 'Y':0, 'LL':0, 'RR':0, 'SELECT':0, 'START':0, 'UP':0, 'DOWN':0, 'LEFT':0, 'RIGHT':0}

controllers['EAST'] = {'NAME':'EAST', 'ALIVE': '0','A': 0, 'B': 0, 'X':0, 'Y':0, 'LL':0, 'RR':0, 'SELECT':0, 'START':0, 'UP':0, 'DOWN':0, 'LEFT':0, 'RIGHT':0}

controllers['WEST'] = {'NAME':'WEST', 'ALIVE': '0','A': 0, 'B': 0, 'X':0, 'Y':0, 'LL':0, 'RR':0, 'SELECT':0, 'START':0, 'UP':0, 'DOWN':0, 'LEFT':0, 'RIGHT':0}



Lumos Functions[edit]

lumosf.run_in_background(cmd) -> runs a command in a background process (max 1 concurrent, spawning a new one will kill the old)

lumosf.stop_in_background() -> kill the background process

lumosf.run_in_foreground(filepath) -> name a python file to run in the main foreground process where it's called from