Difference between revisions of "User:Bloemist/Lumos"
(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...") |
|||
Line 2: | Line 2: | ||
== Import Libraries == | == Import Libraries == | ||
− | import lumos # Lumos > functionality to send output to a screen | + | '''import lumos''' # Lumos > functionality to send output to a screen |
− | import lumosc # Lumos Controllers > read controller input | + | |
− | import lumosf # Lumos Functions > process management | + | '''import lumosc''' # Lumos Controllers > read controller input |
+ | |||
+ | '''import lumosf''' # Lumos Functions > process management | ||
Line 11: | Line 13: | ||
== Lumos Controllers == | == Lumos Controllers == | ||
− | lumosc.controllers -> a python dictionary containing all info about the controllers | + | '''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['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['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['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} | 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 == | == 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.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 | + | '''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 |
Latest revision as of 11:21, 4 May 2022
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