User:Bloemist/Lumos

From HSG Wiki
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