Skip to main content

Interface to Objects In Space from CircuitPython embedded hardware

Project description

Objects In Python

Interface to Objects In Space for CircuitPython embedded hardware.

build status version license code style


Download the compiled module and copy them to your board. Note there are two versions: "full" or regular for boards with more memory (eg, M4/samd51) and "tiny" for boards with less memory (eg, M0/samd21). When using the tiny build, be sure to rename the module to oip.mpy.

$ cp -X oip.mpy /Volumes/CIRCUITPY/oip.mpy


$ cp -X oip-tiny.mpy /Volumes/CIRCUITPY/oip.mpy


Objects In Python uses a simple, event-based API to execute your functions when buttons are pressed or game values update. Getting started is as easy as importing the module, creating the interface, and starting the connection:

from oip import OIP

oip = OIP()

Turn lights on or off when game state changes:

def iff_active(now, value):
    pixels[0] = BLUE if value else RED

Connect buttons to game commands:
def thrust_while_holding(now, value):
    oip.execute("BURN_MAIN_ENGINE" if value else "STOP_MAIN_ENGINE")

With the full build, use helper classes to mitigate typoes:

def iff_active(now, value):
def thrust_while_holding(now, value):
    oip.execute(Command.BURN_MAIN_ENGINE if value else Command.STOP_MAIN_ENGINE)

Check out the example projects for more ideas.


Objects In Python is copyright John Reese, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for objectsinpython, version 0.9
Filename, size File type Python version Upload date Hashes
Filename, size objectsinpython-0.9.tar.gz (12.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page