Skip to main content

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 (currently tested up to 3.8). The author believes any version of Python 3 will work https://www.python.org/downloads/. 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. The sparki_learning library presently depends on pyserial (https://pyserial.readthedocs.io/en/latest/pyserial.html) and pysimplegui (https://pysimplegui.readthedocs.io/en/latest/), which should be installed automatically.
  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/

If you'd like to support my work, my bitcoin address is bc1q3jndk44fzhtg0m0z95933flm6fhw239yuvwvqd / dogecoin is D6R66NfzPkB2SvjCnjh3vZNz2PVnRkfRnj

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

Metadata

Release files for sparki-learning 1.6.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sparki-learning 1.6.9
File Size Uploaded Provenance Actions
sparki_learning-1.6.9.tar.gz 34.9 kB Without provenance Details for sparki_learning-1.6.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sparki-learning 1.6.9
File Interpreter ABI Platform Actions
sparki_learning-1.6.9-py3-none-any.whl Python 3 none any Details for sparki_learning-1.6.9-py3-none-any.whl

Total release size: 72.4 kB

Release files / sparki_learning-1.6.9.tar.gz

Download URL sparki_learning-1.6.9.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1aecd3e3641f21687702d61de3129fcfb4377ba0b6514ad1db5a4a8db46fca14
BLAKE2b-256 checksum
How to use checksums
3a99f0afd60723fb61b5441d496d31e20f097823be4d06972caa6aa9a69d18ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.9

Release files / sparki_learning-1.6.9-py3-none-any.whl

Download URL sparki_learning-1.6.9-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c93e7ee82a5e2c615d0a8c5697288920a5256020c3ef469a459243a1b04103c
BLAKE2b-256 checksum
How to use checksums
b06ae98f5720a4e50a3dce422e462e5a8d4b69d679e3a508ef7789e7a21a0e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.9

Security for sparki-learning 1.6.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.

Release history Release notifications | RSS feed

This release

1.6.9 This release

2 release files No provenance

1.1.3

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page