Difference between revisions of "User:Bloemist/Lumos"

From HSG Wiki
Jump to: navigation, search
(Created page with " == Import Libraries == import lumos # Lumos > functionality to send output to a screen import lumosc # Lumos Controllers > read controller input import lumosf # Lumos...")
(No difference)

Revision as of 11:18, 4 May 2022

Import Libraries

import lumos # Lumos > functionality to send output to a screen import lumosc # Lumos Controllers > read controller input import lumosf # Lumos Functions > process management


Lumos

Lumos Controllers

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

controllers dictionary: 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

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