Skip to main content

A Python module to control Micromelon Robots over BLE, TCP, or Serial with a Raspberry Pi connected to the rover

Project description

Micromelon Logo

Micromelon Python Module

This module provides an API for connecting and controlling Micromelon Rovers and simulated rovers in the Micromelon Robot Simulator.
The API is equivalent to what is available in the Micromelon Code Editor application.

Installation

pip install micromelon

Usage

After import you will need a reference to the RoverController

from micromelon import *
rc = RoverController()

The RoverController object contains all the functionality for connection and control of the robot's state.
At the start of any script that controls the rover you will need to connect and put the rover in a running state. Once complete you will need to return the rover to the idle state and optionally you can end the Python program.

rc.connectBLE(1) # Connects over Bluetooth to rover with ID of 1
rc.startRover() # Puts in running state

# Body of script controlling rover
# eg. Motors.write(20, 20, 1)

rc.stopRover() # Returns to idle state
rc.end() # Disconnects and end Python program

Full code examples available in the examples folder.

Documentation

Generating Documentation

Full API documentation available at https://micromelon-robotics.github.io/mm-pymodule/

Documentation is generated through the python module pdoc3.
Full documentation on pdoc available here.

1. Installing pdoc

Install pdoc through pip.
Requires python 3.

pip3 install pdoc3

2. Generating HTML

pdoc --html --template-dir docs/pdoc_templates -o docs micromelon -f

3. Running docs locally

You can run the documentation as a webserver on your local machine with:

pdoc --http : micromelon

Then open http://localhost:8080/ in a browser.

Building

Get Python build tool

python -m pip install --upgrade build

Build package

python -m build

Uploading

Install twine

python -m pip install --upgrade twine

Uploading

python -m twine upload dist/*

Project details


Download files

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

Source Distribution

micromelon-1.2.0.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micromelon-1.2.0-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file micromelon-1.2.0.tar.gz.

File metadata

  • Download URL: micromelon-1.2.0.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for micromelon-1.2.0.tar.gz
Algorithm Hash digest
SHA256 a0b20eb9fea07042923db9039e8119e7cf3fb73858cb02487caabd55182842d4
MD5 16d83d918c5079143b45895d2661893a
BLAKE2b-256 d094e7537603ced135eecf7880f4238514c1d5225016e8a39fd3139ca64ba24e

See more details on using hashes here.

File details

Details for the file micromelon-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: micromelon-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for micromelon-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2efb805ceac6aed06c604f6cc398b05e63fa6c84df831af1c9a7c3ed52725f29
MD5 4b6bb40be72abb866607902d902263c2
BLAKE2b-256 6430b4439ab5806c84f8fc92130ca2d884487c26588ae9a51672c02a6d8e10cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page