GithubHelp home page GithubHelp logo

dbirman / morseapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ilyasukhanov/morseapi

0.0 2.0 0.0 42 KB

Unofficial API for controlling Wonder Workshop's Dot and Dash robots

License: Other

Makefile 0.57% Python 99.43%

morseapi's Introduction

MorseAPI

MorseAPI is an unofficial (and unsanctioned) python library for controlling Wonder Workshop's Dash and Dot robots.

The robots are controlled with commands sent over Bluetooth, specifically GATT. MorseAPI abstracts out this communication protocol and, through python methods exposes control of lights, motion and sensor data.

Compatibility

MorseAPI has only been tested on GNU/Linux platforms. It should work with any reasonably modern Distro. Limitation is mostly on the BlueZ version, and bluetooth adapter compatibility. Raspberry Pi is a particularly attractive platform for running MorseAPI. Its a small enough package that it can be attached to the robot making for a fully integrated, and portable package. Raspbian in particular has been tested in this combination. Note, that Raspberry does not come with a built in bluttooth module, so a USB bluetooth accessory is required.

In theory it should be possible to us MorseAPI on OSX. To do so you must use pygatt's BGAPI backend. But it does require a very special bluetooth adapter; BLED112. Again OSX has not been tested.

Motivation

There exist smartphone apps which allow remote-controlling Dash and Dot, and even "writing programs" for them. However, the programming functionality is limited to drag-and-drop style and does not allow interaction with any industry programming languages.

That doesn't need to be the case - young kids can get started with the simple drag-and-drop interface to get some exposure and instill interest, then graduate to a programming API interface in order to create more complicated and complete implementations of their creative ideas.

MorseAPI provides that programming interface, in a language that is easy to pick up even for non-engineers: Python.

Installation

This is only tested on Debian, though it should work on other Linux flavors. OSX and Windows are NOT supported.

Steps:

  • first clone this repo and cd into it
  • apt-get install bluez # version 5+ is required by pygatt
  • git clone https://github.com/peplin/pygatt
  • pip install -r requirements.pip

Completeness

Dash and Dot have many different commands. Morse implements only fraction there of:

  • LED Lights:
  • Ears
  • Top of Head
  • Neck / Eye backlight
  • Individual iris LEDs
  • Iris brightness
  • tail light
  • Motion (Dash only)
  • Head pitch and Yaw
  • Move back and forth
  • Turn left and right
  • Sound
  • Playback of built in sounds
  • Uploading new sounds
  • Sensor feedback
  • Microphone volume
  • Proximity Sensing
  • Head pitch / yaw
  • wheel rotation
  • Dash sensing of Dot
  • Robot picked / bumped / toppled oved
  • Sound direction
  • Gyro pitch/yaw/roll
  • Vertical acceleration
  • Clap
  • Battery state
  • Robot discovery
    • feature discovery (Dash & Dot have different feature sets)

Example

Run:

examples/clock.py C0:F0:84:3C:51:FA

where C0:F0:84:3C:51:FA should be the bluetooth address of your bot

$ python
>>> from morseapi import MorseRobot
>>> bot = MorseRobot("C0:F0:84:3C:51:FA")
>>> bot.say("hi")
>>> bot.move(100)
>>> bot.turn(45)
>>> bot.ear_color("red")
>>> bot.head_yaw(10)
>>> bot.eye(255)
>>> bot.eye(100)

morseapi's People

Contributors

ilyasukhanov avatar mpavlov avatar

Watchers

James Cloos avatar Dan Birman avatar

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.