Skip to main content

library to implement the Myro API with the Sparki robot

Project description

This project implements libraries for the Sparki robot <http://arcbotics.com/products/sparki/> to work through Python over a Bluetooth connection. It is intended to help educators who are teaching using the Sparki and/or Python.

Conceptually, the library which is loaded on the robot is simply an interpreter for commands the Sparki receives over its Serial1 (Bluetooth) port. You could implement a complementary library on any platform that you like to send the commands. In this case, I have implemented a library in Python which makes use of the pyserial library to send those commands. The library on the Sparki does not implement all the commands available on the Sparki. Specifically, there are several LCD commands which I have been unable to fit into the Sparki’s memory. As of version 1.1.2 of the Sparki library, it consumes 27,606 bytes of the 28,672 bytes available on the little robot. Perhaps programmers more skilled than I can fit more on there.

The Python part of the library implements much of the IPRE (Institute for Personal Robotics in Education <http://www.roboteducation.org/>) Myro API (API reference at <http://calicoproject.org/Calico_Myro>). This API was originally chosen because the original author of this project taught (or teaches, depending on when you read this) a class making use of that program. A free textbook exists to teach that program may be found at <http://calicoproject.org/Learning_Computing_With_Robots_Using_Calico_Python>. The Python library here does not implement all of that library – in particular, anything having to do with the camera cannot be implemented on Sparki because Sparki does not have that hardware.

To make use of this library with your Sparki: 1. Download the latest version of Sparkiduino from Arcbotics: <http://arcbotics.com/products/sparki/start/> 2. Make a copy (through git clone or otherwise) on your computer of the sparki_myro.ino file – it has to be in its own directory called sparki_myro 3. Load the sparki_myro.ino file in Sparkiduino and upload it to your Sparki (see <http://arcbotics.com/lessons/how-to-upload-sparki-code/> for directions) 4. You’re done! At least, you’re done with the part that concerns your Sparki. The library on its own won’t do much unless you’ve got a way to talk to it.

To talk to the library using Python: 1. Pair your Sparki with your computer over Bluetooth. 2. Download a version of Python 3 – this was originally developed on Python 3.4, and on subsequent versions of Python 3. The author believes any version of Python 3 will work <https://www.python.org/downloads/>. The author has also successfully used Python 2.7, though it is not as thoroughly tested. In my classroom, we use the Thonny IDE available from <https://thonny.org/>. 3. Use pypi, easy_install or pip to install the library (e.g. ‘pip install sparki-learning’). It should download everything for you automagically. If you’re using Thonny, you can go to Tools -> Manage Packages to download the library. 4. Use the sparki_learning library to control your Sparki!

All of the software in this project that I’ve written is provided under the Apache version 2 license available at <http://www.apache.org/licenses/LICENSE-2.0> and is WITHOUT WARRANTY, including implied warranties. I have also included a couple of sample / test programs for you to look at in python to get a feel for how to use the library.

The implementation of the Bresenham line algorithm was adapted from https://github.com/encukou/bresenham, and is provided under the MIT license.

Both libraries were written with the intention of being helpful to students and educators, and are fairly well commented. I have tested them some, but they may not work on all platforms for all people. There may be bugs. There may be problems that cause the destruction of your Sparki (though I don’t think there are). You assume all risk in your use of this software.

Finally, I have included an increasingly long “Quick Reference” sheet that documents the libraries. It’s also available online at <https://sparki-learning.readthedocs.io/en/latest/>

Sparki is an excellent little robot, and I hope this proves useful to you in exploring the world. Good luck!

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

sparki_learning-1.5.2.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

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

sparki_learning-1.5.2.1-py2.py3-none-any.whl (34.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sparki_learning-1.5.2.1.tar.gz.

File metadata

  • Download URL: sparki_learning-1.5.2.1.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.4

File hashes

Hashes for sparki_learning-1.5.2.1.tar.gz
Algorithm Hash digest
SHA256 1377b564d10a215724935234186d09a55c2632981718b40bb43c8cf8ef6d7e32
MD5 988f69612def616247b4e63d73f28a7e
BLAKE2b-256 c03d85adc18114ec42ad52a74a6253e0331ca3b1a480f59335a7ad0282a9c252

See more details on using hashes here.

File details

Details for the file sparki_learning-1.5.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: sparki_learning-1.5.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.4

File hashes

Hashes for sparki_learning-1.5.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aa72f4f1d3ad5a39511f1de23b57a6e5a56adae54d8bf91d06c49b57b3c183f3
MD5 e59c04efd81e6181c7f42d572282aa46
BLAKE2b-256 6c840642421f4fc2a9c8c546b4009abfcc88d8ab54fb69f4c413d6c357ccd7e9

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