Objects In Python
Interface to Objects In Space for CircuitPython embedded hardware.
Install
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
OR
$ cp -X oip-tiny.mpy /Volumes/CIRCUITPY/oip.mpy
Overview
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()
...
oip.start()
Turn lights on or off when game state changes:
@oip.on("IFF_ACTIVE")
def iff_active(now, value):
pixels[0] = BLUE if value else RED
Connect buttons to game commands:
@oip.press(board.BUTTON_A)
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:
@oip.on(Boolean.IFF_ACTIVE)
def iff_active(now, value):
...
@oip.press(board.BUTTON_A)
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.
License
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.
Metadata
Release files for objectsinpython 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| objectsinpython-0.9.tar.gz | 12.3 kB | Without provenance | Details for objectsinpython-0.9.tar.gz |
Release files / objectsinpython-0.9.tar.gz
| Download URL | objectsinpython-0.9.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13e8c332309d83db9982cdcb64ee8294425a5457c61e0e95d962614bb183d769
|
|
BLAKE2b-256 checksum How to use checksums |
172d93c2d7050554e1b2345e721dde36f4a07d18005cff826f4a1b268ccc7c0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for objectsinpython 0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.