GithubHelp home page GithubHelp logo

saxophone's Introduction

The Saxophone (& Guitar) Playing Lunchbox on Wheels Project, controlled by Slack

The code for the project used for my Elixir Conf Europe 2016 talk How to Build a Slack-Controlled, Saxophone-Playing Robot (on Wheels) Using Elixir and Nerves. The project consists of a plastic kitchen container with 2 M&Ms Rockstar's attached to the lid and to GPIO pins 22 and 27 of a Raspberry PI 2. Movement is supplied by 2 28BYJ-48 stepper motors with ULN2003 controllers connected to other GPIO pins.

Various batteries and other bits and bobs are also needed. I will add Step by step instructions, including physical construction, to the Cultivate blog.

Getting started

I am assuming Raspberry PI 2 for now. There will be some extra steps for getting setup with a different model but it should all work.

Configuring the build environment

Taken from the Nerves-examples project, mix branch.

On OS X:

brew update
brew upgrade elixir   ## v1.2.4, BUT NOT HEAD!!
brew install coreutils fwup

On All Platforms:

mix local.hex # update hex
mix archive.install https://github.com/nerves-project/archives/raw/master/nerves_bootstrap.ez

Setting up your environment

cp config/rpi2/config.secret.exs.example config/rpi2/config.secret.exs
cp rel/vm.args.example rel/vm.args
  1. Add your own Slackbot token to config.secret.exs
  2. You can also modify the static IP you would prefer for your robot in config.secret.exs. (I suggest using a static IP for now as it is easier to remote shell and find.)
  3. Add your chosen IP to the -name in vm.args. This will make it easy to attach a remote console or observer to your robot.

Test and Dev

mix deps.get
mix test

Tests should run and be green. If they are not, let me know as it means I've been very bad.

Running iex -S mix should enable you to browse to the web interface at http://localhost:4000. It should also attach to your Slack.

Getting on to the Raspberry PI

Add an SD card to your SD card writer.

MiX_ENV=prod mix compile
MiX_ENV=prod mix firmware
MIX_ENV=prod mix firmware.burn

This should prompt you for a password and burn the image to the SD card. (I hope there was nothing you wanted to save on there.)

Control and monitoring

You should be able to browse to the IP address that you have set up (port 80).

Web interface

If the Slackbot token is set up properly you should also be able to control through the Slackbot interface. You can invite the Slackbot to a room or DM. The following commands are available:

  • slackbot play sax
  • slackbot play guitar
  • slackbot forward
  • slackbot back
  • slackbot left
  • slackbot right
  • slackbot stop

saxophone's People

Contributors

paulanthonywilson avatar

Stargazers

Milada avatar Connor Rigby avatar Dorian Karter avatar Jeff Smith avatar Olov Johansson avatar Lars Krantz avatar Anand Dhillon avatar

Watchers

James Cloos avatar Joachim Kueter avatar  avatar

saxophone's Issues

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.