avoss19 / bsmLib

Library for BSM Robotics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to BSM Lib

Python Library Created For BSM Robotics. Tested on Python versions 2.7 & 3

Install

Python 2.7:

sudo -H pip install git+https://github.com/BSMRKRS/bsmLib.git

Python 3:

sudo -H pip3 install git+https://github.com/BSMRKRS/bsmLib.git

* Make sure the dependencies are installed

Update

Python 2.7:

sudo -H pip install --upgrade git+https://github.com/BSMRKRS/bsmLib.git

Python 3:

sudo -H pip3 install --upgrade git+https://github.com/BSMRKRS/bsmLib.git

Modules

controller - Game controller class
hidePrints - Hides print to console called by any function
networking - Networking classes
RPL - RoboPiLib: Communicate w/ RoboPi hat
vector - Vector math class

RoboPi Reference

RoboPi Reference - BSMRKRS's instructions for operating Raspberry Pi w/ RoboPi hat
Offical RoboPi Documentation - Offical documentation by Mikronauts

Misc Functions

clear - Clears Console
map(value, old_min, old_max, new_min, new_max) - Returns value mapped to new range

Example

from bsmLib import *

RPL.init() # Init RoboPi
RPL.servoWrite(0, 1000) # Write to pin 0

or

import bsmLib

bsmLib.RPL.init() # Init RoboPi
bsmLib.RPL.servoWrite(0, 1000) # Write to pin 0

*More examples can be found in the examples folder

Dependencies

  • python-serial - RoboPiLib

Python 2.7

sudo apt-get install python-serial

Python 3

sudo apt-get install python3-serial
  • PyGame - Controller

Python 2.7

sudo -H pip install pygame

Python 3

sudo -H pip3 install pygame

Troubleshooting

Installation error:

Try to install w/ sudo

Python 2.7

sudo -H python setup.py install

Python 3

sudo -H python3 setup.py install

Run Error:

Reinstall Dependencies

Python 2.7

pip install pygame
sudo apt-get install python-serial

Python 3

pip3 install pygame
sudo apt-get install python3-serial

License

License

About

Library for BSM Robotics


Languages

Language:Python 100.0%