Code Monkey home page Code Monkey logo

flotilla-python's Introduction

Flotilla Python API

This library interfaces with Flotilla over USB serial.

Installing

We've created an installation script that will install the Flotilla python API and update your Dock in the process. To run it fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop like so:

Finding the terminal

In the new terminal window type the following and follow the instructions:

curl -sS https://get.pimoroni.com/flotilla | bash

IMPORTANT

If you've installed Rockpool, you need to shut down the Flotilla Daemon before you start talking to the dock using the present python API:

sudo service flotillad stop

Generic python installing

Download or clone this repository and follow the instructions:

cd flotilla-python
pip install ./library

Now you'll be able to use Flotilla with python. Make sure your dock connected.

>>> import flotilla
>>> dock = flotilla.Client()
>>> dock.ready
True

flotilla-python's People

Contributors

alexdarie avatar gadgetoid avatar graycrow avatar johnbatty avatar jonas-olofsson avatar mritzco avatar roguem avatar sonntagsgesicht avatar tanyafish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flotilla-python's Issues

Matrix brightness documentation wrong

The new matrix documentation seems to be wrong about setting individual matrix pixel brightness.
set_pixel takes x and y coordinates and a state (0 or 1).
set_brightness from 0 to 255 can only be set for the complete matrix, not for each pixel.

Client.first doesn't return the "first" one

After all these years. I've finally (officially) noticed that Client.first(x) doesn't return the first module of type x. It returns the first available module of type x. That isn't always the first x module by channel, just the first one of type x in the available list.
You need to either sort the available list by channel, or return the first module of type x connected in channel order. Or just do something extremely similar to finding the nth module by type as in cookbook where, in this case, n is 1 (as in first).

Number and Matrix don't have a stop method

When dock.stop is called it calls stop for all modules. I think the idea was to tidy up all the modules on exit, wasn't it?
Motors stop and Rainbows stop (are cleared), but Number and Matrix modules don't stop, they only have clear functions, which are not called on exit.
You need to add a stop alias for clear which would then clear the Number and Matrix on exit. And also fix the clearing of Number apostrophe and colon too (see issue #27)

Shut down Motor on host dropping serial connection

Feature request?

When a program quits the flotilla dock simply stops, and does nothing. However if motors are running they keep running, which is potentially a bad idea. While the host program can (should) stop the motors if it exits cleanly, if it crashes or is killed then cleanup might not happen.

Could the dock firmware be updated to detect that the serial connection has been dropped, and make it fail-safe? This would primarily apply to motors, but would also be good for rainbow

Online installer does not work with Buster

Flotilla "firmware" updater will not run on Buster from the online installer.

It looks like some files have been updated for buster, but the "update_firmware" still needs the lines:
elif cat /etc/os-release | grep -q "buster"; then
IS_SUPPORTED=true && IS_EXPERIMENTAL=false

copied into the "raspbian_check()" function.

Motion module doesn't return magnetometer values

The python motion module only returns the accelerometer x, y and z values. The magnetometer x, y and z values are not returned (as they aren't defined in the python code!).
It's easy enough to add the 3 missing data values to the motion module code, upgrade the python package manually, and then everything works as expected!

matrix can't find variable _xstart

The latest changes to the globals seem to have broken the matrix code. I don't have a joystick to check if it's the same issue.
I think you've probably forgotten self. in a few places.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.