This release is a pre-release and may not be stable for production use.
[](https://travis-ci.org/chris104957/robot-blocks)
[](https://codeclimate.com/github/chris104957/robot-blocks/maintainability)
*This project is still under construction*
# introduction
about the project
---
This project is intended to provide a simple framework for quickly building source code for robotics projects:
- allows rapid development with minimal writing of code (refer to below basic example)
- multithreaded processsing based on hooks/callbacks - removes need for writing multiple loops yourself and facilitates management of robot components
- comprehensive library of classes for handing interactions with common robot components (motors, servos, ultrasounds, etc.)
- provides built-in support for multiple control methods (e.g. autonomous obstacle avoidance, remote control, etc.)
# getting started
installation
---
install with pip
```bash
pip install robot-blocks
```
basic example
---
this library is meant to allow you to create software for your robot with as few lines of code as possible. Here is a minimal example for creating an obstacle avoidance robot with 2 motors and an ultrasound sensor
```python
# imports
from robotblocks import Robot
# configure robot
my_robot = Robot()
my_robot.add_motor(position='LEFT', forward_pin=9, backward_pin=10)
my_robot.add_motor(position='RIGHT', forward_pin=8, backward_pin=7)
my_robot.add_sensor('UltrasoundSensor', position='FRONT', input_pin=17, output_pin=18)
# start movement
my_robot.start()
```
callbacks and hooks
---
this library provides a full set of hooks that you can use to trigger certain events when your robot is doing certain things. For example:
```python
def turn_lights_on():
"""
Turns on the robot's lights
"""
...
def turn_lights_off():
"""
turns off the robot's lights
"""
my_robot.add_callback('ON_MOVE_FORWARDS_START', turn_lights_on)
my_robot.add_callback('ON_BRAKE', turn_lights_off)
```
# misc
licence
---
The project is licensed under the Apache license.
support
---
for help on this project, please raise an [issue](https://github.com/chris104957/robot-blocks/issues)
Metadata
Release files for robot-blocks 0.1.0a8
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 | |
|---|---|---|---|---|
| robot-blocks-0.1.0a8.tar.gz | 8.3 kB | Without provenance | Details |
Release files / robot-blocks-0.1.0a8.tar.gz
| Download URL | robot-blocks-0.1.0a8.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e916458d0d7fbe27f91e8b4a3ab7badaa2d32ab6e88508d444b3158f95dca7ac
|
|
BLAKE2b-256 checksum How to use checksums |
1648976d078dfe4576daf6c5d646ed57a653a0602e74277ffbdbcc278702f942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for robot-blocks 0.1.0a8
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.